-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fixing precedence issue with the import of values. #12480
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: 8080 and 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: