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

Do fail on a possible typo in needs entries #2026

Merged
merged 6 commits into from
Dec 18, 2021
Merged

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Dec 17, 2021

Helmfile kindly fails with a friendly error when you made a typo in a needs entry, i.e. a needs entry to an undefined release triggers an error, instead of silently running the helmfile command with a wrong DAG.

Example Output:

in ./helmfile.needs.yaml: release(s) "app" depend(s) on an undefined release "infrastructure/cert-manager2".
Perhaps you made a typo in `needs` or forgot defining a release named "cert-manager2" with appropriate
`namespace` and `kubeContext`?

This prevents issues like #1959

Helmfile kindly fails with a friendly error when you made a typo in a `needs` entry, i.e. a `needs` entry included a reference to a release that is not defined in the helmfile config.

Example Output:

```
in ./helmfile.needs.yaml: release(s) "app" depend(s) on an undefined release "infrastructure/cert-manager2". Perhaps you made a typo in `needs` or forgot defining a release named "cert-manager2" with appropriate `namespace` and `kubeContext`?
```

This prevents issues like #1959
@mumoshu mumoshu mentioned this pull request Dec 17, 2021
@mumoshu mumoshu merged commit 9efb7af into master Dec 18, 2021
@mumoshu mumoshu deleted the fail-on-typo-in-need-entry branch December 18, 2021 08:44
@kuzaxak
Copy link

kuzaxak commented Jan 14, 2022

Related to that change: #2048

Should I provide an example repo to reproduce an issue?

@adecchi-2inno
Copy link

HI Users, I get this error with multiples releases in a machine where is the first time execute the helmfile command.
When I execute the helmfile command in my machine where I previously installed the releases I do not have this error, but if someone else try to execute the helmfile command in other machine where he clone the repository they get the error.

@mumoshu
Copy link
Collaborator Author

mumoshu commented Jan 22, 2022

@adecchi-2inno Hmm, isn't that due to the version difference?

@vbergbauer
Copy link

vbergbauer commented Feb 22, 2022

This release seems to be breaking common usage of selectors, when one release "needs" another.
For example:

$ helmfile --selector=release=vault status
in ./helmfile.yaml: in .helmfiles[1]: in csi-secrets-store/helmfile.yaml: release(s) "vault/vault" depend(s) on an undefined release "kube-system/secrets-store-csi-driver". Perhaps you made a typo in "needs" or forgot defining a release named "secrets-store-csi-driver" with appropriate "namespace" and "kubeContext"?

$  helmfile --selector=release=vault template --skip-deps
in ./helmfile.yaml: in .helmfiles[1]: in csi-secrets-store/helmfile.yaml: release(s) "vault/vault" depend(s) on an undefined release "kube-system/secrets-store-csi-driver". Perhaps you made a typo in "needs" or forgot defining a release named "secrets-store-csi-driver" with appropriate "namespace" and "kubeContext"?

These work fine with the previous version

w33dw0r7d pushed a commit to w33dw0r7d/helmfile that referenced this pull request Mar 8, 2022
* Do fail on a possible typo in `needs` entries

Helmfile kindly fails with a friendly error when you made a typo in a `needs` entry, i.e. a `needs` entry included a reference to a release that is not defined in the helmfile config.

Example Output:

```
in ./helmfile.needs.yaml: release(s) "app" depend(s) on an undefined release "infrastructure/cert-manager2". Perhaps you made a typo in `needs` or forgot defining a release named "cert-manager2" with appropriate `namespace` and `kubeContext`?
```

This prevents issues like roboll#1959

* Fix regression in helmfile-diff (This may break when you had two or more duplicated releases that are intended to be de-duplicated before DAG calculation using selectors

* Fix regression when you used selector to deduplicate releases before DAG calculation

* Comments

* Fix regressions in helmfile-apply and helmfile-sync

* Fix regression in duplicate release detection
@wutongjoe
Copy link

wutongjoe commented Apr 5, 2022

have same issue as vbergbauer , was OK on 0.141 and 0.142 but failed on 0.143 and 0.144

This release seems to be breaking common usage of selectors, when one release "needs" another. For example:

$ helmfile --selector=release=vault status
in ./helmfile.yaml: in .helmfiles[1]: in csi-secrets-store/helmfile.yaml: release(s) "vault/vault" depend(s) on an undefined release "kube-system/secrets-store-csi-driver". Perhaps you made a typo in "needs" or forgot defining a release named "secrets-store-csi-driver" with appropriate "namespace" and "kubeContext"?

$  helmfile --selector=release=vault template --skip-deps
in ./helmfile.yaml: in .helmfiles[1]: in csi-secrets-store/helmfile.yaml: release(s) "vault/vault" depend(s) on an undefined release "kube-system/secrets-store-csi-driver". Perhaps you made a typo in "needs" or forgot defining a release named "secrets-store-csi-driver" with appropriate "namespace" and "kubeContext"?

These work fine with the previous version

@mumoshu
Copy link
Collaborator Author

mumoshu commented Apr 5, 2022

@vbergbauer @wutongjoe I can't say for sure because it really depends on your exact setup, but try messing with --include-needs=[true,false], --include-transitive-needs=[true,false] depending on your requirement

@mumoshu
Copy link
Collaborator Author

mumoshu commented Apr 5, 2022

And please don't be hesitant to open new issues with full details rather than commenting on an existing pull request. That makes me tracking the problem too hard!

Repository owner locked as resolved and limited conversation to collaborators Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants