File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 97
97
echo
98
98
fi
99
99
100
- eshopRegistry=` az acr show -n $eshopAcrName --query " loginServer" -otsv`
101
100
102
- if [ -z " $eshopRegistry " ]
103
- then
101
+ echo " Giving AKS access to ACR instance \" $eshopAcrName \" ..."
102
+ retryCount=0
103
+ eshopRegistry=" "
104
+
105
+ while [ -z " $eshopRegistry " ] && [ $retryCount -lt 10 ]; do
106
+ eshopRegistry=$( az acr show -n $eshopAcrName --query " loginServer" -otsv)
107
+ 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
110
+ retryCount=$(( retryCount+ 1 ))
111
+ fi
112
+ done
113
+
114
+ if [ -z " $eshopRegistry " ]; then
104
115
echo " ${newline}${errorStyle} ERROR! ACR server $eshopAcrName doesn't exist!${defaultTextStyle}${newline} "
105
116
exit 1
106
117
fi
119
130
az role assignment create \
120
131
--role AcrPull \
121
132
--assignee-object-id $aksIdentityObjectId \
133
+ --assignee-principal-type ServicePrincipal \
122
134
--scope $acrResourceId \
123
135
--output none
124
136
fi
You can’t perform that action at this time.
0 commit comments