Skip to content

Commit 6f31147

Browse files
update e2e step sleep until cluster is active
1 parent 78bea51 commit 6f31147

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

.github/workflows/k8s-e2e.yaml

+20-14
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,26 @@ jobs:
291291
CLUSTER_API_GATEWAY_ENDPOINT=${{ steps.bootstrap_cluster.outputs.cluster_api_gateway_endpoint }}
292292
CLUSTER_UUID=${{ steps.bootstrap_cluster.outputs.cluster_id }}
293293
CLUSTER_SECRET=${{ steps.bootstrap_cluster.outputs.cluster_secret }}
294-
295-
response=$(curl -s -X GET "$CLUSTER_API_GATEWAY_ENDPOINT/cluster/$CLUSTER_UUID" \
296-
-H "Content-Type: application/json" \
297-
-H "Authorization: $CLUSTER_UUID $CLUSTER_SECRET")
298-
299-
status=$(echo $response | jq -r '.results[0].status')
300-
301-
if [ "$status" != "active" ]; then
302-
echo "Cluster status is not active, current status: $status"
303-
exit 1
304-
else
305-
echo "Cluster status is active"
306-
exit 0
307-
fi
294+
n=0
295+
until [ "$n" -ge 60 ]
296+
do
297+
response=$(curl -s -X GET "$CLUSTER_API_GATEWAY_ENDPOINT/cluster/$CLUSTER_UUID" \
298+
-H "Content-Type: application/json" \
299+
-H "Authorization: $CLUSTER_UUID $CLUSTER_SECRET")
300+
301+
status=$(echo $response | jq -r '.results[0].status')
302+
303+
if [ "$status" != "active" ]; then
304+
echo "Cluster status is not active, current status: $status, retrying"
305+
n=$((n+1))
306+
sleep 10
307+
else
308+
echo "Cluster status is active"
309+
exit 0
310+
fi
311+
done
312+
echo "Cluster status is not active"
313+
exit 1
308314
309315
- name: Record Test Start Time
310316
run: echo "TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)