Skip to content

Commit f6e854b

Browse files
committed
check cluster status
Signed-off-by: JeffMboya <[email protected]> check cluster status Signed-off-by: JeffMboya <[email protected]>
1 parent 64882c6 commit f6e854b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/lint-test.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ jobs:
4343
echo "changed=true" >> "$GITHUB_OUTPUT"
4444
fi
4545
46+
- name: Set up Kubectl
47+
uses: azure/setup-kubectl@v1
48+
with:
49+
version: v1.27.3
50+
id: install_kubectl
51+
52+
- name: Check if Kubernetes cluster is running
53+
run: |
54+
retries=10
55+
while [ $retries -gt 0 ]; do
56+
if kubectl get all; then
57+
echo "Kubernetes cluster is running."
58+
break
59+
else
60+
echo "Kubernetes cluster not ready, retrying in 30 seconds..."
61+
retries=$((retries-1))
62+
sleep 30
63+
fi
64+
done
65+
if [ $retries -eq 0 ]; then
66+
echo "Cluster did not become ready after multiple attempts."
67+
exit 1
68+
fi
69+
if: steps.list-changed.outputs.changed == 'true' && steps.install_kubectl.outcome == 'success'
70+
4671
- name: Run chart-testing (lint)
4772
if: steps.list-changed.outputs.changed == 'true'
4873
run: |

0 commit comments

Comments
 (0)