ApplyPodTemplateOverride
Applies overrides from a K8SPod template to an existing Kubernetes object's metadata and extracts the pod specification. It merges annotations and labels from the pod template's metadata into the object's metadata and unmarshals the pod template's pod specification.
def ApplyPodTemplateOverride(
objectMeta: metav1.ObjectMeta,
podTemplate: *core.K8SPod
) - > (*v1.PodSpec, metav1.ObjectMeta, error)
Applies overrides from a K8SPod template to an existing Kubernetes object's metadata and generates a new PodSpec. This function is used to customize pod configurations based on predefined templates.
Parameters
| Name | Type | Description |
|---|---|---|
| objectMeta | metav1.ObjectMeta | The existing Kubernetes object metadata to which annotations and labels from the pod template will be merged. |
| podTemplate | *core.K8SPod | The K8SPod template containing the desired annotations, labels, and pod specification to apply as overrides. |
Returns
| Type | Description |
|---|---|
(*v1.PodSpec, metav1.ObjectMeta, error) | A tuple containing the overridden PodSpec, the updated ObjectMeta, and an error if unmarshaling fails. |