chartmuseum / helm-push

Helm plugin to push chart package to ChartMuseum
Apache License 2.0
670 stars 170 forks source link

Adding the Gitlab Helm repository was successful, but pushing the Helm chart failed. #186

Closed sunznx closed 1 year ago

sunznx commented 1 year ago

From Gitlab documentation at https://docs.gitlab.com/ee/user/packages/helm_repository/ , find it supports Helm repositories with an URL-encoded project_id.

image

When the project_id here is URL-encoded, an error occurs. The following commands show an example of this:

# echo ${HELM_REPO_PROJECT}
xxxx%2Fxxxx%2Fxxxxxxxx        # a url-encoded project_id

# helm repo add \
    --username ${HELM_REPO_USER} \
    --password ${HELM_REPO_PASSWORD} \
    my-test-repo \
    https://gitlab.com/api/v4/projects/${HELM_REPO_PROJECT}/packages/helm/stable

"my-test-repo" has been added to your repositories

# helm cm-push --debug --force ./ --version v1.0.0 my-test-repo
Pushing hello-world-v1.0.0.tgz to my-test-repo...
Error: 404: 404 Not Found

Found this error caused by the code at https://github.com/chartmuseum/helm-push/blob/64aa9209f26d26aee061ec6973d8d476109a7034/pkg/chartmuseum/download.go#L13 The encoded-URL will decode after url-parsed