From dcfb745b1f382d371aae5cd260241406b36bbf1a Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Thu, 13 Jan 2022 20:44:02 +0200 Subject: [PATCH 1/2] Improve the bootstrap e2e cleanup Delete the repository regardless of the bootstrap test exit code. Signed-off-by: Stefan Prodan --- .github/workflows/bootstrap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index b20c2669..92a6c608 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -110,6 +110,7 @@ jobs: GITHUB_REPO_NAME: ${{ steps.vars.outputs.test_repo_name }} GITHUB_ORG_NAME: fluxcd-testing - name: delete repository + if: ${{ always() }} run: | curl \ -X DELETE \ From 62755b4b75b3f2cb6996a2a71d7b9140f71154fa Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 14 Jan 2022 10:30:36 +0200 Subject: [PATCH 2/2] Wait 60s for image automation before failing the test Signed-off-by: Stefan Prodan --- .github/workflows/bootstrap.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 92a6c608..90d8802d 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -103,8 +103,20 @@ jobs: /tmp/flux reconcile image repository podinfo /tmp/flux reconcile image update flux-system /tmp/flux get images all - /tmp/flux get images policy podinfo | grep "5.2.1" - /tmp/flux get image update flux-system | grep commit + + retries=10 + count=0 + ok=false + until ${ok}; do + /tmp/flux get image update flux-system | grep 'commit' && ok=true || ok=false + count=$(($count + 1)) + if [[ ${count} -eq ${retries} ]]; then + echo "No more retries left" + exit 1 + fi + sleep 6 + /tmp/flux reconcile image update flux-system + done env: GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} GITHUB_REPO_NAME: ${{ steps.vars.outputs.test_repo_name }}