From f8ee2f99b480ac562829465e5fa2724dc68fd999 Mon Sep 17 00:00:00 2001
From: Michael McLeroy <michaelmcleroy@cloudfitsoftware.com>
Date: Wed, 11 Aug 2021 14:37:28 -0400
Subject: [PATCH] ci: add retry to crictl call for images

---
 .gitlab-ci.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 20cbb2bdbf..6644597541 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -110,9 +110,10 @@ clean install:
     - *deploy_bigbang
     - *test_bigbang
 
-    # Fetch list of all images ran
+    # Fetch list of all images ran (retry crictl up to 6x)
     - cid=$(docker ps -aqf "name=k3d-${CI_JOB_ID}-server-0")
-    - docker exec $cid crictl images -o json | jq -r '.images[].repoTags[0] | select(. != null)' | tee images.txt
+    - images=$(timeout 65 bash -c "until docker exec $cid crictl images -o json; do sleep 10; done;")
+    - echo $images | jq -r '.images[].repoTags[0] | select(. != null)' | tee images.txt
   artifacts:
     paths:
       - images.txt
-- 
GitLab