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

Diff is incorrect when values in values.yaml change and --reuse-values is used #457

Open
chaehni opened this issue May 5, 2023 · 1 comment

Comments

@chaehni
Copy link

chaehni commented May 5, 2023

We realized that the produced diff is incorrect for a helm upgrade call if new values have been added to values.yaml.

Example:

  1. install any chart
  2. modify the chart such that it has a new value in values.yaml (e.g. new_label: testing)
  3. modify the chart to set this label in a ressource:
  labels:
    new_label: {{ .Values.new_label }}
  1. call helm diff upgrade <release> <chart> --reuse-values - the diff shows the new label as new_label: testing

This diff is incorrect. With --reuse-values the new value in values.yaml should not slip in. helm upgrade <release> <chart> --reuse-values --dry-run correctly generates the manifest with the label new_label: nil. This is correct, the value new_label does not exist in the original install and since we used --reuse-values the new base values are ignored.

I'm aware that I can tell helm diff to use --dry-run to generate the diff via env. But I feel like this should be the default. Forgetting to set the env creates diffs that are incorrect.

@lindhe
Copy link

lindhe commented Sep 17, 2024

In this project's README, it says:

This is a Helm plugin giving you a preview of what a helm upgrade would change.
It basically generates a diff between the latest deployed version of a release
and a helm upgrade --debug --dry-run.

That makes it sound like diff using --dry-run is the default. Is it not?

EDIT: Later in the README, it seems to contradict itself and agree with you:

Set HELM_DIFF_USE_UPGRADE_DRY_RUN=true to use helm upgrade --dry-run instead of helm template to render manifests from the chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants