OverridePrimaryContainerName
Overrides the name of the primary container within a PodSpec. It iterates through the containers in the provided PodSpec and renames the container matching primaryContainerName to defaultContainerName.
def OverridePrimaryContainerName(
podSpec: *v1.PodSpec,
primaryContainerName: string,
defaultContainerName: string
) - > null
Overrides the name of the primary container within a given PodSpec. This is necessary to comply with naming conventions enforced by operators like PyTorch and TensorFlow, which expect specific container names.
Parameters
| Name | Type | Description |
|---|---|---|
| podSpec | *v1.PodSpec | The Kubernetes PodSpec object whose primary container name needs to be overridden. This object is modified in place. |
| primaryContainerName | string | The current name of the primary container to be identified and renamed within the PodSpec. |
| defaultContainerName | string | The new name to assign to the primary container, typically a name required by an operator (e.g., 'pytorch' or 'tensorflow'). |
Returns
| Type | Description |
|---|---|
null | This function does not return any value; it modifies the provided PodSpec in place. |