Skip to content

Commit

Permalink
added a while loop in the workflow to know when the pod is ready: fix…
Browse files Browse the repository at this point in the history
… again
  • Loading branch information
giladAlboher committed Jan 27, 2024
1 parent ce24505 commit 69552b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ jobs:
- name: Wait for Pods to be running
run: |
SECONDS=0
TIMEOUT=60 # Set your desired timeout in seconds here
while [[ $(kubectl get pods -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do
TIMEOUT=600 # Set your desired timeout in seconds here
POD_COUNT=$(kubectl get pods --no-headers -o custom-columns=:metadata.name | wc -l)
while [[ $(kubectl get pods -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}' | grep -o "True" | wc -l) -ne $POD_COUNT ]]; do
if [[ $SECONDS -gt $TIMEOUT ]]; then
echo "Timed out waiting for pods to be ready"
exit 1
fi
kubectl get pods
kubectl get pods
sleep 1
done
Expand Down

0 comments on commit 69552b9

Please sign in to comment.