- Add new type EnvironmentVar to emulate k8s' EnvVar type structure with
an EnvironmentFrom nested type (EnvironmentFrom represents everything
relevant in k8s' EnvVarSource type)
- Modify env mapper to store environmental variables in an array of
EnvironmentVar types to preserve their order (variables of type EnvFromSource
are still kept separate like upstream).
Problems:
When we created workloads in rancher api, the environment variable
field is converted without a specific order.(we simplely loop in the
map). This will cause K8s workload spec to change constantly if we do a
update, and cause the pod getting recreated.
Solutions:
Sort the map and make sure they always follow the same order in k8s
workload spec.