Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1b85024

Browse files
committedDec 12, 2023
Better wait logic for ACR
1 parent 1c49686 commit 1b85024

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎deploy/k8s/create-acr.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@ retryCount=0
103103
eshopRegistry=""
104104

105105
while [ -z "$eshopRegistry" ] && [ $retryCount -lt 10 ]; do
106+
exec &> /dev/null
106107
eshopRegistry=$(az acr show -n $eshopAcrName --query "loginServer" -otsv)
108+
exec >& /dev/tty
109+
107110
if [ -z "$eshopRegistry" ]; then
108-
echo "ACR instance wasn't ready. If this takes more than a minute or two, something is probably wrong. Trying again in 5 seconds..."
109-
sleep 5
111+
echo "ACR instance wasn't ready. I'll keep trying for up to 5 minutes..."
112+
sleep 30
110113
retryCount=$((retryCount+1))
111114
fi
112115
done
@@ -126,7 +129,6 @@ aksIdentityObjectId=$(az aks show -g $eshopRg -n $ESHOP_AKSNAME --query identity
126129
if [ ! -z "$aksIdentityObjectId" ]
127130
then
128131
acrResourceId=$(az acr show -n $eshopAcrName -g $eshopRg --query id -o tsv)
129-
130132
az role assignment create \
131133
--role AcrPull \
132134
--assignee-object-id $aksIdentityObjectId \

0 commit comments

Comments
 (0)
Please sign in to comment.