Skip to content

Commit 192d190

Browse files
authored
Merge pull request #1972 from k8s-infra-cherrypick-robot/cherry-pick-1962-to-release-1.0
[release-1.0] use `docker login` as a workaround for capzci ACR
2 parents ed800e4 + fafdfff commit 192d190

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hack/ensure-acr-login.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
set -o errexit
1818
set -o nounset
1919
set -o pipefail
20+
set +o xtrace
2021

2122
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2223
cd "${REPO_ROOT}" || exit 1
@@ -27,4 +28,10 @@ if [[ "${REGISTRY:-}" =~ capzci\.azurecr\.io ]]; then
2728
: "${AZURE_SUBSCRIPTION_ID:?Environment variable empty or not defined.}"
2829
az account set -s "${AZURE_SUBSCRIPTION_ID}"
2930
az acr login --name capzci
31+
# TODO(mainred): When using ACR, `az acr login` impacts the authentication of `docker buildx build --push` when the
32+
# ACR, capzci in our case, has anonymous pull enabled.
33+
# Use `docker login` as a suggested workaround and remove this target when the issue is resolved.
34+
# Issue link: https://github.com/Azure/acr/issues/582
35+
# Failed building link: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cloud-provider-azure/974/pull-cloud-provider-azure-e2e-ccm-capz/1480459040440979456
36+
docker login -u "${AZURE_CLIENT_ID}" -p "${AZURE_CLIENT_SECRET}" capzci.azurecr.io
3037
fi

0 commit comments

Comments
 (0)