Wait for namespace in e2e testing
@@ -20,8 +20,20 @@ helm install --name flux --wait \
--set-string ssh.known_hosts="${KNOWN_HOSTS}" \
${REPO_ROOT}/chart/flux
-#TODO: replace this will long pooling
-sleep 120
+echo '>>> Waiting for namespace demo'
+retries=12
+count=0
+ok=false
+until ${ok}; do
+ kubectl describe ns/demo && ok=true || ok=false
+ sleep 10
+ count=$(($count + 1))
+ if [[ ${count} -eq ${retries} ]]; then
+ kubectl -n flux logs deployment/flux
+ echo "No more retries left"
+ exit 1
+ fi
+done
echo ">>> Flux logs"
kubectl -n flux logs deployment/flux
@@ -30,10 +42,10 @@ echo ">>> Helm Operator logs"
kubectl -n flux logs deployment/flux-helm-operator
echo ">>> List pods"
-kubectl -n test get pods
+kubectl -n demo get pods
echo ">>> Check workload"
-kubectl -n test rollout status deployment/podinfo
+kubectl -n demo rollout status deployment/podinfo
echo ">>> Check Helm release"
-kubectl -n test rollout status deployment/mongodb
\ No newline at end of file
+kubectl -n demo rollout status deployment/mongodb
