Skip to content
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

Improve documentation/template-guide about dependencies to global values in subcharts #1383

Open
Argelbargel opened this issue Oct 28, 2022 · 1 comment
Labels

Comments

@Argelbargel
Copy link

Argelbargel commented Oct 28, 2022

Hi there,

While following the template-guide i ran in to an error when running my subchart after adding a global value to its template.

<.Values.global.buildType>: nil pointer evaluating interface {}.salad

I had expected that helm would "look up" in the directory structure until it finds the "main chart" (that being the chart/directory whose parent-directory does not contain a Chart.yaml) and its values.yaml to provide the global values to the subchart even when running it stand-alone.

The section in the template-guide about adding values to subcharts states (https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#adding-values-and-a-template-to-the-subchart)

"Because every subchart is a stand-alone chart, we can test mysubchart on its own"

And the section about global chart values states (https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values):

"Global values are values that can be accessed from any chart or subchart by exactly the same name"

After reading the comments in helm/helm#4767, i understand why i get an error about .Values.global not being defined when executing only a subchart. I still think it might be good to explicitly state in the template-guide that subcharts using global variables either have to duplicate those in their own values.yaml with default values or cannot be run on their own any longer without explicitly passing the values from the main-chart on the command-line. Perhaps one could explain the explanation with a note that one can install only a specific subchart by declaring it as dependency in the main chart and enabling/disabling it using tags or conditions. As the Topic-Section seemed to be far to "in-depth" for a beginner i started with the templating-guide and its simple(r) examples and read the Topics later.

Kind regards!

@Argelbargel Argelbargel changed the title Improve documentation/template-guide about dependencies to global values Improve documentation/template-guide about dependencies to global values in subcharts Oct 28, 2022
@joejulian joejulian added the docs label Oct 31, 2022
@joejulian
Copy link

@helm/helm-org-maintainers Please move to helm-www

@hickeyma hickeyma transferred this issue from helm/helm Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants