Skip to content

Commit 9d5e877

Browse files
committed
bootstrap: Do not needlessly podman pull
When the release image is already present, the script should not try pulling. This slows down bootstrapping as well as breaking image pre-caching. Signed-off-by: Antoni Segura Puimedon <[email protected]>
1 parent 1e05df7 commit 9d5e877

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

data/data/bootstrap/files/usr/local/bin/release-image-download.sh.template

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,27 @@ set -euo pipefail
1313

1414
RELEASE_IMAGE={{.ReleaseImage}}
1515

16-
echo "Pulling $RELEASE_IMAGE..."
1716
release_image_issue="/etc/issue.d/50_release-image.issue"
18-
while true
19-
do
17+
if podman image exists "$RELEASE_IMAGE"; then
2018
record_service_stage_start "pull-release-image"
21-
if podman pull --quiet "$RELEASE_IMAGE"
22-
then
23-
rm -f "${release_image_issue}"
24-
record_service_stage_success
25-
break
26-
else
27-
printf '\n\\e{lightred}Unable to pull OpenShift release image\\e{reset}\n' >"${release_image_issue}"
28-
record_service_stage_failure
29-
echo "Pull failed. Retrying $RELEASE_IMAGE..."
30-
fi
31-
done
19+
record_service_stage_success
20+
else
21+
echo "Pulling $RELEASE_IMAGE..."
22+
while true
23+
do
24+
record_service_stage_start "pull-release-image"
25+
if podman pull --quiet "$RELEASE_IMAGE"
26+
then
27+
rm -f "${release_image_issue}"
28+
record_service_stage_success
29+
break
30+
else
31+
printf '\n\\e{lightred}Unable to pull OpenShift release image\\e{reset}\n' >"${release_image_issue}"
32+
record_service_stage_failure
33+
echo "Pull failed. Retrying $RELEASE_IMAGE..."
34+
fi
35+
done
36+
fi
3237

3338
# Sanity check the image metadata to see if the arches match
3439
record_service_stage_start "image-metadata-arches-match"

0 commit comments

Comments
 (0)