Skip to content

Commit 3595e48

Browse files
committed
fix: k8s-test workflow by adding a wait loop for K8ssandra operator webhook endpoint readiness, improving deployment reliability.
1 parent f3825e0 commit 3595e48

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/k8s-test.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,26 @@ jobs:
6565
helm install examon deploy/helm/examon \
6666
-f deploy/helm/examon/values-local.yaml \
6767
--set cassandra.enabled=false \
68-
-n examon --create-namespace --timeout 10m
68+
-n examon --create-namespace --wait --timeout 10m
6969
7070
- name: Wait for K8ssandra operator webhook
7171
run: |
72-
echo "Waiting for K8ssandra operator to be ready..."
73-
kubectl wait --for=condition=Ready pod \
74-
-l app.kubernetes.io/name=k8ssandra-operator \
75-
-n examon --timeout=120s
76-
kubectl wait --for=condition=Ready pod \
77-
-l app.kubernetes.io/name=cass-operator \
78-
-n examon --timeout=120s
79-
echo "Waiting for webhook endpoint registration..."
80-
sleep 10
81-
echo "Operators ready."
72+
echo "Waiting for operator webhook endpoint to be registered..."
73+
for i in $(seq 1 30); do
74+
EP=$(kubectl get endpoints examon-k8ssandra-operator-webhook-service \
75+
-n examon -o jsonpath='{.subsets[0].addresses[0].ip}' 2>/dev/null || true)
76+
if [[ -n "$EP" ]]; then
77+
echo "Webhook endpoint ready at $EP."
78+
break
79+
fi
80+
echo " attempt $i/30 — endpoint not ready yet, waiting 5s..."
81+
sleep 5
82+
done
83+
if [[ -z "$EP" ]]; then
84+
echo "ERROR: Webhook endpoint did not become ready in time."
85+
kubectl get endpoints -n examon
86+
exit 1
87+
fi
8288
8389
- name: "Deploy ExaMon (phase 2: full stack with Cassandra)"
8490
run: |

0 commit comments

Comments
 (0)