ToK8sEnvVar
Converts a slice of KeyValuePair objects into a slice of Kubernetes 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 a generic key-value pair representation 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, each containing a 'Key' and 'Value' string that represent 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. |