azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

helm v3.6.1 and acr stopped working

Open josefschabasser opened this issue 5 years ago • 4 comments

Hello!

The latest version of helm (v3.6.1) changed how credentials are handled. Now az acr helm repo add generates non-working configuration. Please add support for helm flag --pass-credentials to set pass_credentials_all: true in ~/.config/helm/repositories.yaml. Without this entry, helm install/upgrade/pull and similar fail with error 401/unauthorized.

for more information please see this helm issue

josefschabasser avatar Jun 24 '21 16:06 josefschabasser

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @toddysm, @yugangw-MSFT, @luisdlp.

Issue Details

Hello!

The latest version of helm (v3.6.1) changed how credentials are handled. Now az acr helm repo add generates non-working configuration. Please add support for helm flag --pass-credentials to set pass_credentials_all: true in ~/.config/helm/repositories.yaml. Without this entry, helm install/upgrade/pull and similar fail with error 401/unauthorized.

for more information please see this helm issue

Author: josefschabasser
Assignees: -
Labels:

Container Registry, Service Attention

Milestone: -

ghost avatar Jun 25 '21 02:06 ghost

route to service team

yonzhan avatar Jun 25 '21 02:06 yonzhan

MS just reverted back to an image with helm v3.6.0. I think this change isn't needed, as the new helm version isn't used (for now), az acr helm repo add is deprecated and manually adding the repository is veeery easy.

REPO=myrepo

CRED=($(az acr credential show --name ${REPO} --query '{username: username, password: passwords[0].value}' -o tsv))
HOST=$(az acr show --name ${REPO} --query 'loginServer' -o tsv)
REPO_URL="https://${HOST}/helm/v1/repo"
ARGS=()

dpkg --compare-versions $(helm version --template "{{.Version}}" | tr -d v) eq 3.6.1
if [[ $? -eq 0 ]]; then
  echo "helm v3.6.1 detected, using '--pass-credentials'"
  ARGS+=('--pass-credentials')
fi

helm repo add ${REPO} ${REPO_URL} \
  --username ${CRED[0]} \
  --password ${CRED[1]} \
  ${ARGS[@]}

EDIT: brought back snippet EDIT 2: only helm v3.6.1 is affected; replaced npm semver with dpkg

josefschabasser avatar Jun 28 '21 08:06 josefschabasser

UPDATE: there was a bug which is fixed in helm v3.6.2. This issue can now be closed.

josefschabasser avatar Jul 01 '21 07:07 josefschabasser