Skip to main content

OverrideContainerSpec

Overrides the specified container's properties in the given podSpec. The function updates the image and command arguments of the container that matches the given containerName.

def OverrideContainerSpec(
podSpec: *v1.PodSpec,
containerName: string,
image: string,
args: []string
) - > error

Overrides the specified container's properties in the given podSpec. The function updates the image and command arguments of the container that matches the given containerName.

Parameters

NameTypeDescription
podSpec*v1.PodSpecThe PodSpec object whose container properties are to be overridden.
containerNamestringThe name of the container within the PodSpec to be updated.
imagestringThe new image name to set for the matching container. If empty, the image will not be updated.
args[]stringThe new command arguments to set for the matching container. If empty, the arguments will not be updated.

Returns

TypeDescription
errorAn error if the operation fails, otherwise nil.