From 4961c3d474be3ca07c2e8ba7c5a091fc3db3aebc Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Mon, 28 Aug 2023 11:29:55 +0200 Subject: [PATCH] chore(ci): Wait for operator pod to start Stabilize the CI workflow and avoid errors due to tests running before operator has completely started --- .github/workflows/kubernetes.yml | 7 +++++++ .github/workflows/nightly.yml | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/kubernetes.yml b/.github/workflows/kubernetes.yml index d556074..9ce4fc9 100644 --- a/.github/workflows/kubernetes.yml +++ b/.github/workflows/kubernetes.yml @@ -39,6 +39,7 @@ jobs: YAKS_VERSION: 0.15.1 YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks" YAKS_RUN_OPTIONS: "--timeout=15m" + KUBECTL_WAIT_TIMEOUT: "180s" steps: - name: Checkout code uses: actions/checkout@v3 @@ -87,6 +88,9 @@ jobs: export KAMEL_INSTALL_REGISTRY_INSECURE=true kamel install + + # Wait for operator to start + kubectl wait pod -l app=camel-k --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS tools uses: citrusframework/yaks-install-action@v1.1 with: @@ -94,6 +98,9 @@ jobs: - name: Install YAKS run: | yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION + + # Wait for operator to start + kubectl wait pod -l app=yaks --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS Tests run: | # Then run integration tests diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7c29dd7..46de72e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,6 +33,7 @@ jobs: YAKS_VERSION: 0.15.1 YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks" YAKS_RUN_OPTIONS: "--timeout=15m" + KUBECTL_WAIT_TIMEOUT: "180s" steps: - name: Checkout code uses: actions/checkout@v3 @@ -81,6 +82,9 @@ jobs: export KAMEL_INSTALL_REGISTRY_INSECURE=true kamel install --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots + + # Wait for operator to start + kubectl wait pod -l app=camel-k --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS tools uses: citrusframework/yaks-install-action@v1.1 with: @@ -88,6 +92,9 @@ jobs: - name: Install YAKS run: | yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION + + # Wait for operator to start + kubectl wait pod -l app=yaks --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS Tests run: | # Then run integration tests @@ -112,6 +119,7 @@ jobs: YAKS_VERSION: 0.15.1 YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks" YAKS_RUN_OPTIONS: "--timeout=15m" + KUBECTL_WAIT_TIMEOUT: "180s" steps: - name: Checkout code uses: actions/checkout@v3 @@ -160,6 +168,9 @@ jobs: export KAMEL_INSTALL_REGISTRY_INSECURE=true kamel install + + # Wait for operator to start + kubectl wait pod -l app=camel-k --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS tools uses: citrusframework/yaks-install-action@v1.1 with: @@ -167,6 +178,9 @@ jobs: - name: Install YAKS run: | yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION + + # Wait for operator to start + kubectl wait pod -l app=yaks --for condition=Ready --timeout=${{ env.KUBECTL_WAIT_TIMEOUT }} - name: YAKS Tests run: | # Then run integration tests