Fix race condition in deploy script

This fixes a race condition in the gate, where `kubectl wait` was
getting called before the objects being waited on existed, which
causes it to fail [0].

[0]: https://github.com/kubernetes/kubernetes/issues/83242
Change-Id: Ideb04bbe62aaaf28f26b91c73412a009c8160265
This commit is contained in:
Sean Eagan 2021-01-28 16:05:05 -06:00
parent 635a6e3b85
commit 2cfdab10a1

View File

@ -4,6 +4,15 @@ sudo snap install kustomize && sudo snap install go --classic
make docker-build
kubectl wait --for=condition=Ready pods --all -A --timeout=180s
make deploy
#Wait for sip controller manager Pod.
#Wait for sip controller manager Pod
count=0
until [[ $(kubectl -n sipcluster-system get pod -l control-plane=controller-manager 2>/dev/null) ]]; do
count=$((count + 1))
if [[ ${count} -eq "120" ]]; then
echo ' Timed out waiting for sip controller manager pod to exist' >&3
return 1
fi
sleep 2
done
kubectl wait -n sipcluster-system pod -l control-plane=controller-manager --for=condition=ready --timeout=240s
kubectl get po -A