ToK8sEnvVar
Converts a slice of core.KeyValuePair objects into a slice of Kubernetes v1.EnvVar objects.
def ToK8sEnvVar(
env: []*core.KeyValuePair
) - > []v1.EnvVar
Converts a slice of KeyValuePair objects into a slice of Kubernetes EnvVar objects. This function is used to transform generic key-value pairs into the specific format required for defining environment variables in Kubernetes pod specifications.
Parameters
| Name | Type | Description |
|---|---|---|
| env | []*core.KeyValuePair | A slice of pointers to KeyValuePair objects, where each object has 'Key' and 'Value' fields representing an environment variable. |
Returns
| Type | Description |
|---|---|
[]v1.EnvVar | A slice of Kubernetes EnvVar objects, where each object contains a 'Name' and 'Value' field corresponding to the input KeyValuePair. |