Skip to main content

GetPrimaryPodAndContainer

Finds the primary pod and container from a LogContext.

def GetPrimaryPodAndContainer(
logContext: *core.LogContext
) - > (*core.PodLogContext, *core.ContainerContext, error)

Finds the primary pod and container from a LogContext. This function is used to retrieve specific log context components for further processing or display.

Parameters

NameTypeDescription
logContext*core.LogContextThe log context object containing information about pods and containers, including the names of the primary pod and container.

Returns

TypeDescription
(*core.PodLogContext, *core.ContainerContext, error)The primary pod context, the primary container context, and an error if the primary pod name is empty, the primary pod is not found, or the primary container is not found within the primary pod.