-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
remove dirname constraint on helm package
#1979
Comments
One workaround for others is to tar/sign the package yourself outside of
The provenance file can be created following this doc: https://github.com/kubernetes/helm/blob/master/docs/provenance.md#the-provenance-file |
Would this actually need to wait until 3.0? It doesn't seem to be backwards-breaking. |
It is "breaking" in the sense that it violates the chart spec, which specifies that a directory name must match the name. One of the reasons to not drift from the spec is that it is reasonable to assume that an unpackaging tool may follow this logic:
It is worth noting that Finally, the reasoning behind this decision in the first place (which I had forgotten when we talked on Slack) is that the chart spec we developed in early 2016 was designed to allow other files and directories to exist inside of the root of a package to make Helm forward-compatibile should we ever decide to do anything crazy (like storing the image in an |
All of that seems reasonable, but this ticket could still be accommodated without modifying the resulting I understand how that's slightly less consistent, but I think there's a legitimate use case here: if I write a little microservice and want to publish it as a GitHub project, a
The alternatives would be to have a nested |
I ran into this problem too today, as I mentioned in the "helm" Slack channel. |
Now that it has been publicly announced, the main reason why I opened this issue is because of draft. Draft expects the application's chart to be inside chart/, and the main use case is to hack on the chart in dev then use @iameli nailed it on the head here as how draft expects the filesystem layout to look like. |
Yeah, I looked at Draft a bit and was squinting at y'all Deis folks for releasing a product that violates your own linter. 🙃 |
hahahahaha @iameli |
'helm package' now produces an error if the directory name and the name in Chart.yaml are not the same.
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
/lifecycle frozen |
Is this issue still open for contribution, or only for further discussion of the feature proposed? |
We’re keeping it open as a discussion point. It’s not something we can accept in the 2.0 milestone as mentioned before, but it’s still good to keep open for when we do planning for a v3.0. :) #2954 is the proposed PR to fix this; it’s just a few lines of code that need to be removed to remove this constraint. |
The existing requirement that the chart directory name and the name of the chart (Chart.yaml "name") is removed. Closes helm#1979
Added test (and needed new test chart) to cover the removed chart directory name constraint. Closes helm#1979
As part of the removal of the chart name and chart directory name matching constraint, this updates the linting rules to no longer error on a mismatch. The requirement that there be a Chart name, covered by validateChartName rule, also covers the removed test case in TestValidateChartNameDirMatch where the Chart name is missing. Closes helm#1979
Oh I don't know how I missed seeing that PR. Thanks for pointing it out @bacongobbler. I had worked on this last night, and just put up a branch on my fork for consideration anyway (master...AmundsenJunior:feat/1979-remove-chart-dirname-constraint). The changeset includes an added test for 'package' to cover the removed constraint, as well as updates to 'pkg/lint' to no longer error on the chart/directory name matching rule. |
I would to echo a statement similar to what others have said. The current constraint on the directory matching what is listed in the Chart.yaml does not really add value and forces a structure that makes several valid layout cases harder to deal with. Similar to my usecase in #3845 |
Since this is something that will be possible in the v3, maybe the best way to sovle it for the v2 is to add a warning? It's "breaking" the spec, but it's going to change anyway in the (near?) future. |
why not just convert the error into a warning and not block the process? |
We would also really like to use chart names that look like this:
Where This would ensure that projects that upload charts to our internal helm repo (Artifactory implementation, it supports subdirectories), will not collide with their chart names. Currently we have to suggest chart names like this, just to disambiguate them: Giving us the freedom to allow So instead of this: example-projects-helm-hello-world:
- apiVersion: v1
created: 2018-09-02T09:58:36.300Z
description: A Helm chart for Kubernetes
digest: 647a9e1578499daf665f842e680f80ec27c613301f0eb2bd99d98cd8623650af
name: example-projects-helm-hello-world
urls:
- local://example-projects/helm-hello-world/example-projects-helm-hello-world-0.0.1.tgz
version: 0.0.1 we could just as well use this example-projects/helm-hello-world/demo:
- apiVersion: v1
name: example-projects/helm-hello-world/demo
urls:
- local://example-projects/helm-hello-world/demo-0.0.1.tgz
version: 0.0.1 I can make a tarball myself, of course, but I would like to be able to use |
I have mentioned my use case #4683, it was closed as a duplicate, but I still have a question to address. As I mentioned, the issue basically making hard such a basic task as building CI pipeline for a chart. I am not really getting what does it has to do with a specs or something - to me the name of parent directory basically is not a property of the chart and that directory is not a jurisdiction of helm. I'm glad it doesn't try to check the name of my user's home directory... |
this was implemented in #4141 which was merged into the Helm 3 branch. Closing |
@llibicpep see #1979 (comment) for a workaround. |
@bacongobbler why not add a CLI flag so that CI can bypass this check for all cases where v2 is being used without affecting default behavior? Having to set a different chart path for every CI configuration and project is hugely annoying & v3 may not be available on Azure devops tools and others for some time. A --flag would be a simple solution that retains v2 behavior by default. |
So what is the final outcome ? How do we overcome this problem? My CI is breaking because of this issue. |
@matthewerwin please open a separate issue for your proposal. thank you. |
When I run
helm package
on a directory that contains chart information, for examplechart/
:This is inconsistent with
helm install
, as I can install any arbitrary directory:From a conversation on Slack, there's no technical reason why this is a limitation other than technical debt that wasn't removed before helm v2.0.0 was released. For Helm 3.0, I propose this limitation should be removed so that I may be able to name my chart package under any directory so long as it follows the chart conventions in the design doc.
The text was updated successfully, but these errors were encountered: