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
Whitelisting in .helmignore with '/*' returns "chart metadata (Chart.yaml) missing" #3622
Comments
hmm. I don't think this is intentional behaviour, but I can see how this happens. I don't think a whitelist approach was in mind when .helmignore was first implemented :) You could probably write a unit test for
effectively cancel each other out, ignoring everything in the current directory. |
Thanks for the answer! Unfortunately I don't think that this is the case. Leaving out "!.helmignore" like this, produces the same error:
However I personally think this should work like .gitignore does, which will ignore everything exept Chart.yaml, templates, and values.yaml. Is there a reason why this behaviour is different in .helmignore or is it just that no one has made a feature request like that yet? On another note, maybe I am on the wrong track here altogether. So I started with the .helmignore file, because tiller wasn't able to create a deployment anymore due to the configmap being to big from all the new files I added into the repo. What I don't really understand is why blacklisting is the "preferred" way in helm. Like I constantly find myself in the situation where I add new files and folders to the root of my repo, all of which I have to manually add to .helmginore (which more often than not I forget 🙈). On the other side I feel like helm doesn't really have a lot of files/folders that need to be added. Additionally from this document, I would assume their structure is pretty much fixed . As a helm beginner this is really confusing to me. Is there something I am missing? |
Yeah that was a simple example. Basically the issue revolves around two negation arguments in the same directory. Instead of a whitelist, you end up with everything being ignored. :)
This is the first time someone's asked for this feature request AFAIK. Feel like working on a PR? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Bump -- seeing the same issue. My
Gets error:
/remove-lifecycle stale |
+1 |
Use case: we've seen a lot of teams unintentionally packaging the tarballs of prior builds in their chart. For example,
As mentioned in the OP, this errors with |
The example I posted above only has one negation ... @bacongobbler should I open a separate issue or do you think it is related? |
No, I think it's related. Adding a single negation worked as it was intended: it marked anything in the root directory other than the In your case, you probably want something like the following:
Which would fail as others have discovered because of the double negation. |
Or, perhaps the following might work in your case?
Give that a shot. |
@bacongobbler no luck:
|
+1 Btw I was wondering, why isn't the default behaviour to ignore everything except the "Chart File Structure" exposed at https://github.com/helm/helm/blob/master/docs/charts.md#the-chart-file-structure ? Why would we want to send other files to Tiller? |
I really would love to use .helmignore as .gitignore. This is my usecase: # .helmignore file contents
!Chart.yaml
!val*.yaml
!templates/
* helm lint .
==> Linting .
[INFO] Chart.yaml: icon is recommended
[ERROR] templates/: validation: chart.metadata is required
Error: 1 chart(s) linted, 1 chart(s) failed helm version: 3.0.2 |
Just deleted all “+1” comments. If you want to upvote this ticket, please use the “thumbs up” reaction in the original comment. That way we can keep the discussion focused without having to filter out any “+1” comments. Thanks! |
The goal has been to never accidentally include non-example kustomizations, yet not to forget the example kustomization. This however does not work the way we want it as expressed in issue #157. The problem is that .helmignore files are broken when it comes to negation[1], which we tried to address in commit 25ee3b9, but that approach also seems to fail. Instead of relying on .helmignore, we'll now rely on the Makefile to verify that no non-example kustomizations are in the directory. It's not pretty, but it works and includes the example sections. 1: helm/helm#3622
The goal has been to never accidentally include non-example kustomizations, yet not to forget the example kustomization. This however does not work the way we want it as expressed in issue #157. The problem is that .helmignore files are broken when it comes to negation[1], which we tried to address in commit 25ee3b9, but that approach also seems to fail. Instead of relying on .helmignore, we'll now rely on the Makefile to verify that no non-example kustomizations are in the directory. It's not pretty, but it works and includes the example sections. 1: helm/helm#3622
Is there any news? |
No news/updates on this topic to share. If you're interested in fixing this, we'd welcome the effort. Though I don't think we can actually make the change until Helm 4 as introducing/fixing this behaviour would result in compatibility breakers. |
.helmignore has "supported" negative matches uselessly for a long time, reported as an open ticket (helm#3622) as early as 2018. This revision implements negative matching correctly and usefully for the first time.
.helmignore has "supported" negative matches uselessly for a long time, reported as an open ticket (helm#3622) as early as 2018. This revision implements negative matching correctly and usefully for the first time. Signed-off-by: Talia Stocks <tstocks@hioscar.com>
.helmignore has "supported" negative matches uselessly for a long time, reported as an open ticket (helm#3622) as early as 2018. This revision implements negative matching correctly and usefully for the first time. Signed-off-by: Talia Stocks <tstocks@hioscar.com>
.helmignore has "supported" negative matches uselessly for a long time, reported as an open ticket (helm#3622) as early as 2018. This revision implements negative matching correctly and usefully for the first time. Signed-off-by: Talia Stocks <tstocks@hioscar.com>
I think we can avoid breaking most compatibility due to the fact that this feature, as written, is nearly useless:
To maintain most backwards compatibility, we could treat a set of rules that, aside from directory rules, only contain negatives as implicitly including
This isn't perfect, however, because some users may currently include redundant positive rules alongside |
It is also worth noting that the documentation states:
The "cryptic" sentence
is misleading - what does it mean "special leading sequence"? In contrast to the earlier statement, it is either a contradiction or it can also be mistakenly understood that (given the earlier point about whitespace in filenames) these are files starting with an exclamation mark (!). Simply put: That sentence is semantically wrong. I think that the solution should be to simply mimic the behavior of |
and there goes an hour of my life wasted.. why would you guys name something after the canonical standard that is |
Hi guys,
I am trying a whitelist approach with the following .helmignore
Unfortunately this gives me the following error:
Is this the desired behavior or am I missing something?
helm/tiller version:
The text was updated successfully, but these errors were encountered: