DeterminePrimaryContainerPhase
DeterminePrimaryContainerPhase as the name suggests, given all the containers, will return a pluginsCore.PhaseInfo object corresponding to the phase of the primaryContainer which is identified using the provided name. This is useful in case of sidecars or pod jobs, where Flyte will monitor successful exit of a single container.
def DeterminePrimaryContainerPhase(
ctx: context.Context,
primaryContainerName: string,
statuses: []v1.ContainerStatus,
info: *pluginsCore.TaskInfo
) - > pluginsCore.PhaseInfo
Determines the phase of the primary container, identified by its name, from a list of container statuses. This is useful for monitoring the successful exit of a single container in scenarios like sidecars or pod jobs.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used for logging. |
| primaryContainerName | string | The name of the primary container whose phase needs to be determined. |
| statuses | []v1.ContainerStatus | A slice of Kubernetes ContainerStatus objects representing the current status of all containers in a pod. |
| info | *pluginsCore.TaskInfo | Additional task information to be included in the returned PhaseInfo. |
Returns
| Type | Description |
|---|---|
pluginsCore.PhaseInfo | A PhaseInfo object corresponding to the primary container's current phase (Running, Success, RetryableFailure, SystemRetryableFailure, or Failure). |