From fedeae3e83a0516d6f802861920a8e0fcae34134 Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:46:30 +0000 Subject: [PATCH] =?UTF-8?q?GitHub=20actions=20-=20began=20to=20capture=20l?= =?UTF-8?q?ogs=20and=20pod=20descriptions=20when=20fail=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e.yaml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8b104d920..a4c58191b 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -21,6 +21,20 @@ jobs: - name: Run the extension developer e2e test run: make extension-developer-e2e + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} + e2e-kind: runs-on: ubuntu-latest steps: @@ -35,6 +49,20 @@ jobs: - name: Run e2e tests run: ARTIFACT_PATH=/tmp/artifacts make test-e2e + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} + - uses: cytopia/upload-artifact-retry-action@v0.1.7 if: failure() with: @@ -59,3 +87,17 @@ jobs: - name: Run the upgrade e2e test run: make test-upgrade-e2e + + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }}