Skip to content

Commit

Permalink
Ensure resource creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
carboxylman committed Jul 4, 2023
1 parent e9c3c39 commit b854406
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion setup-kubernetes-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,16 @@ type: kubernetes.io/service-account-token
EOF
secretid="admin-secret"
fi
token=`kubectl get secrets $secretid -o 'go-template={{.data.token}}' | base64 -d`
tries=5
while [ $tries -gt 0 ]; do
token=`kubectl get secrets $secretid -o 'go-template={{.data.token}}' | base64 -d`
if [ -n "$token" ]; then
break
else
tries=`expr $tries - 1`
sleep 8
fi
done
if [ -z "$token" ]; then
echo "ERROR: failed to get admin token, aborting!"
exit 1
Expand Down

0 comments on commit b854406

Please sign in to comment.