Skip to content

Commit 917e48e

Browse files
Merge pull request #4328 from ggiguash/fix_bootc_embedded_image_pull
NO-ISSUE: Fail the bootc image build if all retries for container pull fail
2 parents 6c1c945 + 947388f commit 917e48e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/image-blueprints-bootc/layer2-source/group2/rhel95-bootc-source-isolated.containerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
3434
--authfile /run/secrets/pull-secret.json \
3535
--root /var/lib/containers/storage-preloaded \
3636
"docker://{{ . }}" && break; \
37-
echo "Attempt $i failed. Retrying in 5 seconds..."; \
38-
sleep 5; \
37+
if [ $i -eq 3 ] ; then \
38+
echo "ERROR: Failed to pull {{ . }} image after 3 attempts"; \
39+
exit 1; \
40+
fi; \
41+
echo "Attempt $i failed. Retrying in 5 seconds..." && sleep 5; \
3942
done
4043
# {{ end }}
4144

test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-isolated.containerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
1414
--authfile /run/secrets/pull-secret.json \
1515
--root /var/lib/containers/storage-preloaded \
1616
"docker://{{ . }}" && break; \
17-
echo "Attempt $i failed. Retrying in 5 seconds..."; \
18-
sleep 5; \
17+
if [ $i -eq 3 ] ; then \
18+
echo "ERROR: Failed to pull {{ . }} image after 3 attempts"; \
19+
exit 1; \
20+
fi; \
21+
echo "Attempt $i failed. Retrying in 5 seconds..." && sleep 5; \
1922
done
2023
# {{ end }}
2124

0 commit comments

Comments
 (0)