Better handling of PATH env var with initConfig #401
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
We got a use-case where we need to defined the
PATH
environment variable through the.Values.environment
node for the statefulset, and we had some issues due to duplicate entries.When
.Values.initConfig
is enabled, the chart actually add aPATH
environment variable.The issue is due to how Kubernetes handle duplicate envvars definition, when a referenced key is present in multiple resources, the value associated with the last source will override all previous values.
As
.Values.initConfig
variable is defined later in the manifest, it will always supersede previously definition, thus our.Values.environment
node was bypassed.This PR will add the following logic:
.Values.initConfig.enabled
and noPATH
in.Values.environment
: add aPATH
envvar like before.Values.initConfig.enabled
andPATH
in.Values.environment
: do not add aPATH
envvar as it should use the one defined in.Values.environment
The rest of the logic is untouched.
why
We wanted to be able to define more specifically how the
PATH
environment variable is presented to the statefulset avoiding any duplicate in the process.tests
PATH
andinitConfig
parametersreferences