Fixing precedence issue with the import of values.#12480
Fixing precedence issue with the import of values.#12480mattfarina merged 1 commit intohelm:mainfrom
Conversation
The ordering should be: 1. User specified values (e.g CLI) 2. Parent chart values 3. Imported values 4. Sub-chart values This enables parnet charts to import large set of values from a child and then override select values. This change is needed for backwards compatibility. Fixes helm#12460 Signed-off-by: Matt Farina <matt.farina@suse.com>
|
LGTMe. Tested this change against the example in #12460, looks good to me (it was also required to update the example chart's values |
joejulian
left a comment
There was a problem hiding this comment.
Passes every test I have to throw at it.
|
This also fixes our regression, tested with https://github.com/ankitabhopatkar13/helm-values-issue. $ diff <(/opt/homebrew/Cellar/helm/3.13.0/bin/helm upgrade --install umbrella umbrella --dry-run --values umbrella/values.yaml) <(/usr/local/bin/helm upgrade --install umbrella umbrella --dry-run --values umbrella/values.yaml)
25c25
< - port: 9090
---
> - port: 1234
47c47
< - port: 9090
---
> - port: 8080and the diff between 3.12.3 and this PR is zero! $ diff <(/opt/homebrew/Cellar/helm/3.12.3/bin/helm upgrade --install umbrella umbrella --dry-run --values umbrella/values.yaml) <(/usr/local/bin/helm upgrade --install umbrella umbrella --dry-run --values umbrella/values.yaml) |
|
This change has a flaw in the sense that the values defined in a sub-chart will not get the values from an import. The import only populates non-existing data in the sub-chart values. Example: exports: Sub-chart values: Result: Can add that the current order of precedence basically is: |
The ordering should be:
This enables parent charts to import large set of values from a child and then override select values.
This change is needed for backwards compatibility.
Fixes #12460
What this PR does / why we need it: The values fixes in 3.13.0 had the wrong prioritization for values which broke backwards compatibility and did not make sense. Imported values should be able to be used (e.g., with a library chart) while being able override select values.
Special notes for your reviewer:
If applicable: