Skip to content

Commit

Permalink
added a while loop in the workflow to know when the pod is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
giladAlboher committed Jan 27, 2024
1 parent e1422c9 commit c46be9a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,18 @@ jobs:
kubectl apply -f trading-app.yaml
kubectl apply -f trading-app-svc.yaml
- name: Take a nap
run: sleep 30
- name: Wait for Pods to be running
run: |
SECONDS=0
TIMEOUT=600 # Set your desired timeout in seconds here
while [[ $(kubectl get pods -n project -l app=project -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do
if [[ $SECONDS -gt $TIMEOUT ]]; then
echo "Timed out waiting for pods to be ready"
exit 1
fi
kubectl get pods -n project
sleep 1
done
- name: Check pods
run: |
Expand Down

0 comments on commit c46be9a

Please sign in to comment.