Skip to content

Helm pull fails if repo URL contains Azure Blob SAS token #11472

@epierotto

Description

@epierotto

Output of helm version:

version.BuildInfo{Version:"v3.10.0", GitCommit:"ce66412a723e4d89555dc67217607c6579ffcb21", GitTreeState:"clean", GoVersion:"go1.19.1"}

Output of kubectl version:
Not applicable

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
Helm repo on Azure Blob with SAS token

We use Azure Blob as Helm repo.
To authenticate we issue SAS tokens with required permissions.
This works perfectly fine if you add the Helm repo

$ helm repo add test 'https://testhelmrepos.blob.core.windows.net/test/upstream/?sp=rl&st=2022-10-26T06:27:46Z&se=2022-10-26T14:27:46Z&spr=https&sv=2021-06-08&sr=c&sig=6AFsNmWcqdm25UeIzOyvfoqPLk3iJjPClu6J6C93rOk%3D'

$ helm repo list
NAME                            URL                                                                                                                                                                                                                                                                                                                                 
test                            https://testhelmrepos.blob.core.windows.net/test/upstream/?sp=rl&st=2022-10-26T06:27:46Z&se=2022-10-26T14:27:46Z&spr=https&sv=2021-06-08&sr=c&sig=6AFsNmWcqdm25UeIzOyvfoqPLk3iJjPClu6J6C93rOk%3D

You can also pull charts by referencing the added Helm repo

$ helm pull --destination /tmp/test --version 12.0.3 test/nginx

What does not work is pulling the Helm chart by providing the repo URL containing the SAS token:

$ helm pull --destination /tmp/test --version 12.0.3 --repo 'https://testhelmrepos.blob.core.windows.net/test/upstream/?sp=rl&st=2022-10-26T06:27:46Z&se=2022-10-26T14:27:46Z&spr=https&sv=2021-06-08&sr=c&sig=6AFsNmWcqdm25UeIzOyvfoqPLk3iJjPClu6J6C93rOk%3D' nginx
Error: failed to fetch https://testhelmrepos.blob.core.windows.net/test/upstream/nginx-12.0.3.tgz : 404 The specified resource does not exist.

You can clearly see in the error that the SAS token is missing from the contructed URL.
If you use curl with the correct URL it just works.

$ curl -O 'https://testhelmrepos.blob.core.windows.net/test/upstream/?sp=rl&st=2022-10-26T06:27:46Z&se=2022-10-26T14:27:46Z&spr=https&sv=2021-06-08&sr=c&sig=6AFsNmWcqdm25UeIzOyvfoqPLk3iJjPClu6J6C93rOk%3D/nginx-12.0.3.tgz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   408  100   408    0     0    968      0 --:--:-- --:--:-- --:--:--   987
$  ls nginx-12.0.3.tgz
nginx-12.0.3.tgz

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions