ApplyContainerImageOverride
Applies a container image override to a specified container within a PodSpec. It iterates through the containers in the PodSpec and updates the image of the container matching the primary container name.
def ApplyContainerImageOverride(
podSpec: *v1.PodSpec,
containerImage: string,
primaryContainerName: string
) - > null
Overrides the container image for a specific container within a given PodSpec. This function is used to modify the image of a primary container, typically for testing or deployment purposes.
Parameters
| Name | Type | Description |
|---|---|---|
| podSpec | *v1.PodSpec | The PodSpec object whose container image needs to be overridden. This object will be modified in place. |
| containerImage | string | The new container image string to apply to the primary container (e.g., "myregistry/myimage:latest"). |
| primaryContainerName | string | The name of the container within the PodSpec to target for the image override. Only the container matching this name will have its image updated. |
Returns
| Type | Description |
|---|---|
null | None |