make curls more failey
@@ -29,9 +29,9 @@ done
pod_name=$(kubectl get po -l app="$app" -o jsonpath='{.items[0].metadata.name}')
internal_ip=$(kubectl get po "$pod_name" -o jsonpath='{.status.podIP}')
-bearer_token=$(curl -u fly:Zmx5 "http://$external_ip:8080/sky/token" -d "grant_type=password&username=$ATC_USERNAME&password=$ATC_PASSWORD&scope=openid+profile+email+federated:id+groups" | jq -r '.access_token')
+bearer_token=$(curl -f -u fly:Zmx5 "http://$external_ip:8080/sky/token" -d "grant_type=password&username=$ATC_USERNAME&password=$ATC_PASSWORD&scope=openid+profile+email+federated:id+groups" | jq -r '.access_token')
-until curl -s -H"Authorization:Bearer $bearer_token" "http://$external_ip:8080/api/v1/workers" | jq -r '.[] | .state' | grep 'running'; do
+until curl -s -f -H"Authorization:Bearer $bearer_token" "http://$external_ip:8080/api/v1/workers" | jq -r '.[] | .state' | grep 'running'; do
echo "Waiting for worker to be running ..."
sleep 5
done
