helm: Error: validation: chart.metadata.version is required on helm package even though --version is used
Output of helm version:
version.BuildInfo{Version:"v3.5.0", GitCommit:"32c22239423b3b4ba6706d450bd044baffdcf9e6", GitTreeState:"clean", GoVersion:"go1.15.6"}
Output of kubectl version: n/a
Cloud Provider/Platform (AKS, GKE, Minikube etc.): n/a
helm package always requires the version field to be set in the Chart.yaml, even if the --version flag is set. Otherwise helm exits with Error: validation: chart.metadata.version is required.
Since helm package ignores the version from the Chart.yaml anyway if it is provided via command line it seems unnecessary and a bit confusing to still require it.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 25 (8 by maintainers)
Commits related to this issue
- Fix build-helm.sh issue with Helm 3.5 As described here https://github.com/helm/helm/issues/9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-statefulset by manno 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here helm/helm#9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-job by rohitsakala 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here helm/helm#9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-secret by rohitsakala 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here helm/helm#9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-secret by rohitsakala 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here helm/helm#9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-secret by rohitsakala 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here helm/helm#9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-job by rohitsakala 3 years ago
- Fix build-helm.sh issue with Helm 3.5 As described here https://github.com/helm/helm/issues/9298 the invalid string no longer works. — committed to cloudfoundry-incubator/quarks-statefulset by manno 3 years ago
- Specify version in marketplace-integration Chart.yaml The version is now required in Chart.yaml even if helm package overrides it: https://github.com/helm/helm/issues/9298#issuecomment-850568389 — committed to kaichengyan/marketplace-k8s-app-tools by kaichengyan 2 years ago
- Specify version in marketplace-integration Chart.yaml The version is now required in Chart.yaml even if helm package overrides it: https://github.com/helm/helm/issues/9298#issuecomment-850568389 — committed to kaichengyan/marketplace-k8s-app-tools by kaichengyan 2 years ago
- Specify version in marketplace-integration Chart.yaml The version is now required in Chart.yaml even if helm package overrides it: https://github.com/helm/helm/issues/9298#issuecomment-850568389 — committed to kaichengyan/marketplace-k8s-app-tools by kaichengyan 2 years ago
- Upgrade kubectl and helm versions and change base image to Ubuntu 20.04 (#589) * Upgrade kubectl to [current GKE versions](https://cloud.google.com/kubernetes-engine/docs/release-notes#current_versio... — committed to GoogleCloudPlatform/marketplace-k8s-app-tools by kaichengyan 2 years ago
- Sync with upstream master (#3) * Add CRD example to deployer_helm2 test (#552) * Add CRD example to deployer_helm2 test * Note that CR cannot be created with approach * Allow selection of st... — committed to kastenhq/marketplace-k8s-app-tools by PrasadG193 2 years ago
- Upgrade kubectl and helm versions and change base image to Ubuntu 20.04 (#589) * Upgrade kubectl to [current GKE versions](https://cloud.google.com/kubernetes-engine/docs/release-notes#current_versio... — committed to GoogleCloudPlatform/marketplace-k8s-app-tools by kaichengyan 2 years ago
@bacongobbler it looks like this issue got introduced with version v3.5.2
The
Validate()function inpkg/chart/metadata.golooks like the following in v3.5.1:While the same function in v3.5.2 has the SemVer check built in:
While the
Run()method of thehelm packagecommand would actually respect the provided--versionflag:it never gets to that point because the
metadataof the Chart is being parsed AND validated at the time the files are being loaded.While the early validation certainly works for most of the other, if not all of the other commands it doesn’t work for
packagewhere you can provide a version via the--versionflag.To fix this there would only really be two options I could see:
packagevia flag)packageis actually trying to doCheers,
Kimba