Helmfile: Helm 3: Error: unknown flag: --purge

Created on 9 Oct 2019  ·  9Comments  ·  Source: roboll/helmfile

We have a release defined in helmfile which has installed: false. As a result, helmfile tries to delete it, but it fails to do so with helm 3.

export HELMFILE_HELM3=1
helmfile sync

output:

Deleting nginx-ingress-public

List of releases in error :
RELEASE
nginx-ingress-public
in ./helmfile.yaml: in .helmfiles[2]: in releases/nginx_ingress_public/nginx-ingress-public.yaml: failed processing release nginx-ingress-public: helm exited with status 1:
  Error: unknown flag: --purge

Helm version: helm3.beta4

bug

Most helpful comment

On the same release, when doing helmfile apply it says:

No affected releases
Comparing release=nginx-ingress, chart=stable/nginx-ingress
in ./helmfile.yaml: in .helmfiles[1]: in releases/nginx_ingress/nginx-ingress.yaml: failed processing release nginx-ingress: helm exited with status 1:
  Error: unknown flag: --reset-values

All 9 comments

On the same release, when doing helmfile apply it says:

No affected releases
Comparing release=nginx-ingress, chart=stable/nginx-ingress
in ./helmfile.yaml: in .helmfiles[1]: in releases/nginx_ingress/nginx-ingress.yaml: failed processing release nginx-ingress: helm exited with status 1:
  Error: unknown flag: --reset-values

@costimuraru Thanks! For the latter case, I'm not sure which command is emitting the error. helm upgrade in helm v3 does seem to have --reset-values so it would be an another command?

Could you try running it with helmfile --log-level=debug so that it will print exactly which command being run before the failure?

Anyways, #890 should fix sync

worker 1/1 finished
worker 1/1 started
Comparing release=nginx-ingress, chart=stable/nginx-ingress
exec: helm diff upgrade --reset-values --allow-unreleased nginx-ingress stable/nginx-ingress --version 1.14.0 --namespace nginx-ingress --values /var/folders/zy/07jyxrn547b1rdn8dczz411h0000gp/T/values986425987 --detailed-exitcode
exec: helm diff upgrade --reset-values --allow-unreleased nginx-ingress stable/nginx-ingress --version 1.14.0 --namespace nginx-ingress --values /var/folders/zy/07jyxrn547b1rdn8dczz411h0000gp/T/values986425987 --detailed-exitcode:
worker 1/1 finished
err: release "nginx-ingress" in "nginx-ingress.yaml" failed: failed processing release nginx-ingress: helm exited with status 1:
  Error: unknown flag: --reset-values

It seems I don't have the right helm-diff plugin.
I see you're working on a branch for helm3: https://github.com/databus23/helm-diff/tree/helm3-beta3
Do we have any compiled version we could download?

1)

I managed to install helm-diff from https://github.com/databus23/helm-diff/tree/helm3-beta3 (it wasn't straightforward, since helm plugin install https://github.com/databus23/helm-diff --version helm3-beta3 didn't quite work)

❯ helm plugin install https://github.com/databus23/helm-diff --version helm3-beta3

...
Use "helm [command] --help" for more information about a command./plugins/helm-diff/bin: File name too long
Failed to install helm-diff
\tFor support, go to https://github.com/databus23/helm-diff.
Error: plugin install hook for "diff" exited with error
❯ helm diff help
Error: fork/exec /Users/cmuraru/Library/helm/plugins/helm-diff/bin/diff: no such file or directory
❯ cp -r /Users/cmuraru/go/src/github.com/databus23/helm-diff/release/diff/bin /Users/cmuraru/Library/Caches/helm/plugins/https-github.com-databus23-helm-diff/bin/

❯ helm diff help
Error: This command needs 2 arguments: release name, chart path
Usage:
  diff [flags]
  diff [command]

Available Commands:
  release     Shows diff between release's manifests
...

2)
helm diff upgrade fails with a couple of errors:

❯ helm diff upgrade --reset-values --allow-unreleased nginx-ingress stable/nginx-ingress --version 1.14.0 --namespace nginx-ingress --values /var/folders/zy/07jyxrn547b1rdn8dczz411h0000gp/T/values726731729 --detailed-exitcode
Error: Couldn't load repositories file (repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Couldn't load repositories file (repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: plugin "diff" exited with error

A) I believe the the repositories.yaml path has changed in helm3 (see https://v3.helm.sh/docs/faq/#i-want-to-delete-my-local-helm-where-are-all-its-files)
For mac:

❯ ls -l $HOME/Library/Preferences/helm
total 8
-rw-------  1 cmuraru  staff  625 Oct  9 23:21 repositories.yaml

B) Why is it complaining about helm init? This doesn't exist in helm3 anymore...

@costimuraru Oh, did helm 3.0.0-beta.4 removed --reset-values from helm upgrade, by any chance? I need to take a look. (At least it worked for beta.3) Nevermind, I missed that it was an error from helm-diff.

The latest helm-diff that should work well with helm 3 best would be @jonasrutishauser's https://github.com/databus23/helm-diff/pull/151.

If you have some time, please try cloning his branch locally, and run HELM_HOME=$HOME/Library/helm make install to build and install the plugin. (A bit more context can be found at https://github.com/roboll/helmfile/issues/668#issuecomment-529104253)

I have also this issue with helmfile 0.93.1 and helm-diff 3.0.0.rc7

➜  helm plugin list
NAME        VERSION     DESCRIPTION                               
diff        3.0.0-rc.7  Preview helm upgrade changes as a diff    
helm-git    0.5.0       Get non-packaged Charts directly from Git.
➜  helmfile -version
helmfile version v0.93.1
worker 1/1 started
worker 1/1 finished
worker 1/1 started
Comparing release=e2e-passhisto, chart=csuite/passhisto
exec: helm diff upgrade --reset-values --allow-unreleased e2e-passhisto csuite/passhisto --version 1.0.0 --namespace default --values /tmp/values470002043 --detailed-exitcode
exec: helm diff upgrade --reset-values --allow-unreleased e2e-passhisto csuite/passhisto --version 1.0.0 --namespace default --values /tmp/values470002043 --detailed-exitcode: Couldn't load repositories file (repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)

worker 1/1 finished

@olivierboudet You are right. Just install helm-diff plugin and it works.

helm plugin install https://github.com/databus23/helm-diff --version master
Was this page helpful?
0 / 5 - 0 ratings