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

Problem if appVersion is a number in scientific notation #201

Open
markusheiden opened this issue Oct 18, 2023 · 4 comments
Open

Problem if appVersion is a number in scientific notation #201

markusheiden opened this issue Oct 18, 2023 · 4 comments

Comments

@markusheiden
Copy link

markusheiden commented Oct 18, 2023

Wrong escaping of appVersion if it is a number in scientific notation.

helm repo add..., e.g. for our GitLab pipeline helm repo add --force-update --username gitlab-ci-token --password ${CI_JOB_TOKEN} ${CI_PROJECT_NAME} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable, results in:

Error: looks like "https://gitlab.com/api/v4/projects/12345678/packages/helm/stable" is not a valid chart repository or cannot be reached: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into Go struct field ChartVersion.entries.appVersion of type string

index.yaml from the GitLab Helm registry pushed with the ChartMuseum helm-push plugin and reduced to the problematic entry:

---
apiVersion: v1
entries:
  voluminator-backend:
    - name: voluminator-backend
      type: application
      version: 1.0.0+392065e2
      apiVersion: v2
      appVersion: 392065e2
      created: '2023-10-02T12:15:46.313353000Z'
      digest:
      urls:
        - charts/voluminator-backend-1.0.0+392065e2.tgz
generated: '2023-10-16T08:18:04.014125519Z'
serverInfo:
  contextPath: "/api/v4/projects/34739132/packages/helm"

Currently, we are using Helm 3.13.0.

I already reported this as helm/helm#12236 but it seems to be a ChartMuseum problem.

This problem already happened some years ago as #40.

@markusheiden markusheiden changed the title Problem if appVersion is number in scientific notation. Problem if appVersion is a number in scientific notation. Oct 18, 2023
@markusheiden markusheiden changed the title Problem if appVersion is a number in scientific notation. Problem if appVersion is a number in scientific notation Oct 18, 2023
@markusheiden
Copy link
Author

I got the problem again with version 63366e78.

@djhoese
Copy link

djhoese commented Sep 17, 2024

Has there been any update on this? I've run into the same issue where a commit SHA used in appVersion is considered a float and gets similar errors to the ones mentioned above. Why are the version numbers not quoted in the produced index.yaml?

@djhoese
Copy link

djhoese commented Sep 17, 2024

Apparently this issue is the same as #40 from what I can tell and should have been fixed in #41. That was released (according to github) in v0.8.0.

@markusheiden
Copy link
Author

I don‘t know what component exactly causes this problem, but I doubt that the GitLab repo uses that old code. So IMO that problem still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants