Skip to main content

BuildPodLogContext

Builds a PodLogContext object from a given Kubernetes Pod object. It extracts the namespace, pod name, primary container name, and details for all regular and init containers.

def BuildPodLogContext(
pod: *v1.Pod
) - > *core.PodLogContext

Builds a PodLogContext object from a given Kubernetes Pod object. This function is used to extract relevant logging information from a pod's status.

Parameters

NameTypeDescription
pod*v1.PodThe Kubernetes Pod object from which to extract log context information.

Returns

TypeDescription
*core.PodLogContextA pointer to a core.PodLogContext object containing the pod's namespace, name, primary container, and lists of all containers and init containers.