Repository navigation
handle null values in helm values correctly - #515
Open
cbarbian-sap wants to merge 2 commits into
Open
cbarbian-sap wants to merge 2 commits into
cbarbian-sap wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CAVEAT: THIS PR contains an incompatible change
In general, when merging JSON/YAML objects, component-operator-runtime does not use any special logic for null values.
That is, for example, merging
and
would result in
However, helm uses a slightly different approach, in order to allow 'unsetting' default values (to really delete keys, instead of just nullifying them). To be precise: When
helm deletes keys which exist in the underlying values and are null-valued in the incoming values. It is worth to note that an incoming null value is preserved if the key does not exist in the underlying values.
In the above example, the helm logic would return:
Note that
b:is gone (because it exists in the underlying data, and was provided with null value in the incoming data)e:is there (because it didn't exist in the underlying data).This PR makes the
HelmGeneratormimic the original helm behaviour. Which could mean an incompatible change in rare cases.