- 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).
This change gives rancher the ability to accept pluggable kontainer engine drivers
by adding the necessary types and removing the driver specific types.
Issue:
rancher/rancher#12698
This change gives rancher the ability to accept pluggable kontainer engine drivers
by adding the necessary types and removing the driver specific types.
Issue:
rancher/rancher#12698
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.
https://github.com/rancher/rancher/issues/14939.
Problems:
we are not using lazy match to match the group (!=|=) so that "foo !=
bar` can be parsed wrongly as (foo !) (=) (bar).
Solutions:
Use lazy match to match as less as possible the characters in the first
group. Also improved the whitespace matches.
This os_info mapper is used for v1.NodeStatus but
there is some case that mapper is evaluated when
v1.NodeStatus is nil. For example, when the user try
to create v3.Node by calling API(POST /v3/nodes).
So we should check data is nil or not before executing
mapper in order to prevent from trying to use data(nil)
as map inside OSInfo.FromInternal