From bbb439997061c37d79d42c7a4ee192cb6822c6e3 Mon Sep 17 00:00:00 2001 From: Lutz Finsterle Date: Sat, 14 Mar 2026 16:52:09 +0100 Subject: [PATCH] Update in test logic --- .gitea/workflows/test.yml | 7 ++++++- .gitlab/workflows/test.gitlab-ci.yml | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 2f5af6c..a274b96 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -114,7 +114,12 @@ jobs: - name: Install Traefik CRDs run: | - kubectl --kubeconfig /tmp/test-kubeconfig apply \ + # Wait for API server to accept connections before applying CRDs + for i in $(seq 1 20); do + kubectl --kubeconfig /tmp/test-kubeconfig get nodes >/dev/null 2>&1 && break + echo "Waiting for API server... ($i/20)"; sleep 3 + done + kubectl --kubeconfig /tmp/test-kubeconfig apply --validate=false \ -f https://raw.githubusercontent.com/traefik/traefik/v2.11/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml kubectl --kubeconfig /tmp/test-kubeconfig wait \ --for=condition=established --timeout=60s \ diff --git a/.gitlab/workflows/test.gitlab-ci.yml b/.gitlab/workflows/test.gitlab-ci.yml index 050753c..4bae4a6 100644 --- a/.gitlab/workflows/test.gitlab-ci.yml +++ b/.gitlab/workflows/test.gitlab-ci.yml @@ -95,7 +95,11 @@ integration-k8s: chmod 600 /tmp/test-kubeconfig - | echo "── Installing Traefik CRDs ──" - kubectl --kubeconfig /tmp/test-kubeconfig apply \ + for i in $(seq 1 20); do + kubectl --kubeconfig /tmp/test-kubeconfig get nodes >/dev/null 2>&1 && break + echo "Waiting for API server... ($i/20)"; sleep 3 + done + kubectl --kubeconfig /tmp/test-kubeconfig apply --validate=false \ -f https://raw.githubusercontent.com/traefik/traefik/v2.11/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml kubectl --kubeconfig /tmp/test-kubeconfig wait \ --for=condition=established --timeout=60s \