Skip to main content

MergeBasePodSpecOntoTemplate

MergeBasePodSpecOntoTemplate merges a base pod spec onto a template pod spec. The template pod spec has some magic values that allow users to specify templates that target all containers and primary containers. Aside from magic values this method will merge containers that have matching names.

def MergeBasePodSpecOntoTemplate(
templatePodSpec: *v1.PodSpec,
basePodSpec: *v1.PodSpec,
primaryContainerName: string,
primaryInitContainerName: string
) - > *v1.PodSpec, error

Merges a base pod specification onto a template pod specification. This function handles magic values in the template pod spec that target all containers and primary containers, and merges containers with matching names.

Parameters

NameTypeDescription
templatePodSpec*v1.PodSpecThe template pod specification, which may contain magic values for default and primary containers.
basePodSpec*v1.PodSpecThe base pod specification to be merged onto the template.
primaryContainerNamestringThe name of the primary container within the base pod specification, used to apply primary container templates.
primaryInitContainerNamestringThe name of the primary init container within the base pod specification, used to apply primary init container templates.

Returns

TypeDescription
*v1.PodSpec, errorThe merged PodSpec, or an error if either the templatePodSpec or basePodSpec is nil, or if any merge operation fails.