Skip to content

Fix issue with precedence of imports. Imports in parent did not overr… - #12590

Closed
intetinte wants to merge 3 commits into
helm:mainfrom
intetinte:main
Closed

intetinte wants to merge 3 commits into
helm:mainfrom
intetinte:main

Conversation

@intetinte

@intetinte intetinte commented Nov 22, 2023 •

Copy link
Copy Markdown

…ide values in subcharts

This pull request fixed the issue described in #12511

The value precedence for import from the parent is set higher than the sub chart values. This enables importing sets of data in the parent that is applied in the sub-charts. This has been possible in older helm versions than 3.8.2 and in 3.13.0. This fix doe not interfere with the other fixes in the value precedence - i.e backwards compatible.

Fix for these:
#12730
#12511

As an addition to these:
#12162
#12480

@pull-request-size pull-request-size Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 22, 2023
@intetinte

Copy link
Copy Markdown
Author

This commit makes it possible to import one or more libraries with values in the parent chart and apply those values on the child charts. The parent library values will take precedence of the child values.
Precedence will be

  1. User specified values
  2. Parent values
  3. parent imports
  4. child values
  5. child imports

Previously it was:

  1. User specified values
  2. Parent values
  3. child values
  4. parent import
  5. child import

@intetinte

Copy link
Copy Markdown
Author

Anyone looking into this?

@intetinte

intetinte commented Feb 28, 2024 •

Copy link
Copy Markdown
Author

Rebased and did some manual comparison with the main branch and the commit on the fork.

Running with helm from main-branch:

$ helm template --set profile.myimport=false mychart # disabled the import of library
---
# Source: test/charts/mysubchart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-cfgmap2
data:
dessert: ice cream <--- This value is set from the umbrella chart values.yaml
topping: nil <--- This value is set in mysubchart values.yaml
servedon: <--- This parameter is not defined in mysubchart values.yaml

Running helm from main-branch:

$ helm template --set profile.myimport=true mychart # enabled the import of library
---
# Source: test/charts/mysubchart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-cfgmap2
data:
dessert: ice cream <--- This value is set from the umbrella chart values.yaml
topping: nil <--- This value is set in mysubchart values.yaml. However the imported library does also set this to another value. Subchart value takes precedence over library value
servedon: plate <--- This value is set in imported library values.yaml

Running helm from this pull request:

$ helm template --set profile.myimport=false mychart # disabled the import of library
---
# Source: test/charts/mysubchart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-cfgmap2
data:
dessert: ice cream <--- This value is set from the umbrella chart values.yaml
topping: nil <--- This value is from subchart
servedon: <--- This parameter is not defined in mysubchart values.yaml

Running helm from this pull request:

$ helm template --set profile.myimport=true mychart # enabled the import of library
---
# Source: test/charts/mysubchart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-cfgmap2
data:
dessert: ice cream <--- This value is set from the umbrella chart values.yaml
topping: sugar <--- This value is set in imported library values.yaml. Subchart does have value nil. Imported value takes precedence over subchart value
servedon: plate <--- This value is set in imported library values.yaml

intetinte and others added 3 commits June 10, 2024 09:34
…ide values in subcharts

Signed-off-by: Tore Johansson <[email protected]>
Signed-off-by: intetinte <[email protected]>
Signed-off-by: intetinte <[email protected]>
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions Bot added the Stale label Aug 23, 2025
@github-actions github-actions Bot closed this Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant