DemystifyFailedOrPendingPod
inspects the pod status of a failed or pending pod and attempts to determine the reason for the failure or pending state. This function currently only handles pods in the Failed or Pending phase. This is useful to check the specific error from the pod in the rayjob, sparkjob, etc. For example, if the pod is in the Failed phase due to an image pull error, this function can return a more specific error message indicating that the image could not be pulled. Similarly, if the pod is in the Pending phase due to insufficient resources, this function can return an error message indicating that the pod could not be scheduled due to lack of resources.
def DemystifyFailedOrPendingPod(
ctx: context.Context,
pluginContext: k8s.PluginContext,
info: pluginsCore.TaskInfo,
namespace: string,
podName: string,
primaryContainerName: string
) - > pluginsCore.PhaseInfo, error
Inspects the pod status of a failed or pending pod and attempts to determine the reason for the failure or pending state. This function currently only handles pods in the Failed or Pending phase. This is useful to check the specific error from the pod in the rayjob, sparkjob, etc.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| pluginContext | k8s.PluginContext | The Kubernetes plugin context, providing access to the Kubernetes client for reading resources. |
| info | pluginsCore.TaskInfo | Information about the task associated with the pod. |
| namespace | string | The namespace of the pod to inspect. |
| podName | string | The name of the pod to inspect. |
| primaryContainerName | string | The name of the primary container within the pod, used for demystifying failures. |
Returns
| Type | Description |
|---|---|
pluginsCore.PhaseInfo, error | A PhaseInfo object containing the demystified status and an error if one occurred during the process. |