Skip to content

Helm2: commit sha App Version getting converted to scientific notation #6922

Closed

Description

@karuppiah7890

Output of helm version -c:
Client: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"}

When app version is a commit sha, it gets converted to a scientific notation when packaging. And package creates a tar ball even though the command errors out with errors in the output.

See below for more details on how to reproduce and about the issue:

$ helm create test

$ # change appVersion to 72225e2
$ vi test/Chart.yaml

$ cat test/Chart.yaml
apiVersion: v1
appVersion: 72225e2
description: A Helm chart for Kubernetes
name: test
version: 0.1.0

$ # notice how it errors out but still creates the tar ball
$ helm package test
Successfully packaged chart and saved it to: /Users/karuppiahoss/oss/helm-issues/issue-6833/dummy-repo-local/test-0.1.0.tgz
Error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into Go struct field ChartVersion.entries.appVersion of type string

$ # check Chart.yaml contents in tar ball
$ vi test-0.1.0.tgz

Chart.yaml contents in the tar ball:

apiVersion: v1
appVersion: "7.2225e+06"
description: A Helm chart for Kubernetes
name: test
version: 0.1.0

The issue is similar to #6921 (v3 issue), in this case it's present in v2 too

Activity

  1. added
    bug
    on Nov 12, 2019
  2. bacongobbler commented on Nov 12, 2019

    @bacongobbler
    Member

    Closing in favour of #6921 to keep the conversation in one place. The codepaths are identical. Thanks.

  3. karuppiah7890 commented on Nov 12, 2019

    @karuppiah7890
    ContributorAuthor

    @bacongobbler we still need to put a fix in dev-v2, which is not exactly identical code path / code base right? Also, I was putting it separate so that when it's fixed, people can already (in v2, before migrating to v3, which will take some time) create proper repo index through this linting and packaging errors, for not putting double quotes, which is way before doing repo index. And repo index just works already and helm3 repo add will not give issues. In fact we can close issue #6849 and have this and #6921 open and fix em

  4. bacongobbler commented on Nov 12, 2019

    @bacongobbler
    Member

    I closed this issue because it's the same issue. Issues can span multiple versions. Opening multiple tickets describing the same issue only confuses the community, as there will be simultaneous conversations occurring at the same time in two issues. It's best to keep conversations that are closely related in one ticket so the community can all discuss solutions in a single ticket, rather than repeating the same conversation twice.

    If we need to discuss implementation details for a particular version, that can be discussed in the PR.

  5. karuppiah7890 commented on Nov 13, 2019

    @karuppiah7890
    ContributorAuthor

    Makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions