New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
environment var array order not being respected #562
Comments
thanks for reporting ! |
responsible code is probably somewhere in https://github.com/metacontroller/metacontroller/blob/master/pkg/dynamic/apply/apply.go |
Fixes metacontroller#562 Signed-off-by: Grzegorz Głąb <grzesuav@gmail.com>
@jordan-da Created a test case and narrow down the place when it happens. Current logic indeed does not respect reordering. Need to check if adjusting that won't cause any issues |
digging a bit further, In case of merging listMaps, metacontrller tries to preserve partial order, that is why the original order (https://github.com/metacontroller/metacontroller/blob/master/pkg/dynamic/apply/apply.go#L156). In this case it does not make sense, as in both cases ( |
When updating an existing workload's environment vars, the order of the vars is not respected. This is important because in kubernetes you are allowed to reference environment vars that were previously defined in other environment vars as per:
So if the environment var order is non-deterministic, you can not do native environment var expansion.
Example
Initial
Updated
Result
If the order is not maintained, you can never really use
$(VAR1)
in a subsequent environment var because you have no way to ensure that the var with the reference is defined where it is suppose to be:Example
Initial
Updated
Result
The text was updated successfully, but these errors were encountered: