helm-www icon indicating copy to clipboard operation
helm-www copied to clipboard

Document precedence of --set / -f flags

Open jdolitsky opened this issue 4 years ago • 4 comments

The --set flag always take precedence over -f flag no matter the order in which they are provided on the command line.

The order is in code but not yet documented: https://github.com/helm/helm/blob/03ccd5dea2516e5da275653aa4485064377a7fd5/pkg/cli/values/options.go#L41-L86

jdolitsky avatar Jun 02 '20 21:06 jdolitsky

Hi @jdolitsky. The order and precedence is documented with helm help install, and is available here: https://github.com/helm/helm/blob/03ccd5dea2516e5da275653aa4485064377a7fd5/cmd/helm/install.go#L46-L68

Documented here: https://helm.sh/docs/helm/helm_install/

is there another location this should be documented?

bacongobbler avatar Jun 02 '20 22:06 bacongobbler

This part of the doc seems to contradict that: https://helm.sh/docs/chart_template_guide/values_files/

hickeyma avatar Jun 03 '20 07:06 hickeyma

@bacongobbler I might need to clarify- I didn't find anything in those locations related to this issue. Did I miss it?

Here is an example:

echo "tag: v0.5.0" > staging.yaml

# Order #1
helm install demo mychart/ --set tag=v0.6.0-rc1 -f staging.yaml

# Order #2
helm install demo mychart/ -f staging.yaml --set tag=v0.6.0-rc1

I was half expecting that the first helm install command would produce v0.5.0 for {{ .Values.tag }}, but it is always v0.6.0-rc1 due to --set taking precedence.

jdolitsky avatar Jun 04 '20 15:06 jdolitsky

Hi @jdolitsky. The order and precedence is documented with helm help install, and is available here: https://github.com/helm/helm/blob/03ccd5dea2516e5da275653aa4485064377a7fd5/cmd/helm/install.go#L46-L68

Documented here: https://helm.sh/docs/helm/helm_install/

is there another location this should be documented?

Flag group that consists of -f/--values and --set-* is present in the multiple commands: template, install, upgrade ...
I expect all of them has that information. For example template page doesn't tell anything about it.

A possible solution is to create a dedicated page and add a link to it to the command line help

  -f, --values strings               specify values in a YAML file or a URL (can specify multiple), see more details about usage with other flags in the ....
...   
  --set stringArray              set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) , see more details about usage with other flags in the ....

Cjkjvfnby avatar Jul 29 '21 12:07 Cjkjvfnby