Allow overwriting inline values with targetPath #1060
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.
Fix: fluxcd/flux2#2330
When using Helm with both a values file and --set, the set will always have precedence over the values.yaml. This allows specifying the normal config inside a yaml file and specifying a secret outside that yaml via --set.
When using flux, this normally works too (using inline values to specify most of the config and a reference with targetPath to get a secret), but if you want to overwrite a secret key inside an array the inline values will always overwrite the whole array and the referenced secret key will not appear at all.
By making sure that when you specify a targetPath it has precedence over inline values it will be merged properly.
The Workaround mentioned in the original issue is limiting, because you can not easily use kustomize to overwrite certain keys in a configmap values.yaml stringBlock (for example in a multicluster setup with a common base), but you can do it with inline values.