BuildPodLogContext
Builds a PodLogContext object from a given Kubernetes Pod object. It extracts the namespace, pod name, primary container name, and creates contexts for both 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, such as its namespace, name, primary container, and details about all its containers and init containers.
Parameters
| Name | Type | Description |
|---|---|---|
| pod | *v1.Pod | The Kubernetes Pod object from which to build the log context. This object provides all the necessary metadata about the Pod and its containers. |
Returns
| Type | Description |
|---|---|
*core.PodLogContext | A pointer to a core.PodLogContext object containing the extracted log context information for the Pod. |