Skip to content

Commit

Permalink
chore: using loop to check status
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed May 21, 2024
1 parent b110164 commit 7bfe164
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions .github/actions/setup-greptimedb-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,16 @@ runs:
- name: Wait for GreptimeDB
shell: bash
run: |
sleep 5s
kubectl get pods -n my-greptimedb
kubectl wait \
--for=condition=Ready \
pod -l app.greptime.io/component=my-greptimedb-meta \
--timeout=120s \
-n my-greptimedb
sleep 5s
kubectl get pods -n my-greptimedb
kubectl wait \
--for=condition=Ready \
pod -l app.greptime.io/component=my-greptimedb-datanode \
--timeout=120s \
-n my-greptimedb
sleep 5s
kubectl get pods -n my-greptimedb
kubectl wait \
--for=condition=Ready \
pod -l app.greptime.io/component=my-greptimedb-frontend \
--timeout=120s \
-n my-greptimedb
while true; do
PHASE=$(kubectl -n my-greptimedb get gtc my-greptimedb -o jsonpath='{.status.clusterPhase}')
if [ "$PHASE" == "Running" ]; then
echo "Cluster is ready"
break
else
echo "Cluster is not ready yet: Current phase: $PHASE"
sleep 5 # wait for 5 seconds before check again.
fi
done
- name: Print GreptimeDB info
if: always()
shell: bash
Expand Down

0 comments on commit 7bfe164

Please sign in to comment.