Skip to main content

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

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for logging.
primaryContainerNamestringThe name of the primary container whose phase needs to be determined.
statuses[]v1.ContainerStatusA slice of Kubernetes ContainerStatus objects representing the current status of all containers in a pod.
info*pluginsCore.TaskInfoAdditional task information to be included in the returned PhaseInfo.

Returns

TypeDescription
pluginsCore.PhaseInfoA PhaseInfo object corresponding to the primary container's current phase (Running, Success, RetryableFailure, SystemRetryableFailure, or Failure).