-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
data/bootstrap: extract ironic images from release image
startironic.sh now uses the ironic images specified in the release. In order to do that, this change pulls out the code from bootkube to get the images to it's own script, and adds a service that downloads the release image so it only happens once.
- Loading branch information
Showing
8 changed files
with
49 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
data/data/bootstrap/files/usr/local/bin/release-image-download.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
RELEASE_IMAGE={{.ReleaseImage}} | ||
|
||
echo "Pulling $RELEASE_IMAGE..." | ||
while ! podman pull --quiet "$RELEASE_IMAGE" | ||
do | ||
echo "Pull failed. Retrying $RELEASE_IMAGE..." | ||
done |
13 changes: 13 additions & 0 deletions
13
data/data/bootstrap/files/usr/local/bin/release-image.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# This library provides an `image_for` helper function which can get the | ||
# pull spec for a specific image in a release. | ||
|
||
# Convert the release image pull spec to an "absolute" form if a digest is available | ||
if ! RELEASE_IMAGE_DIGEST=$( podman inspect {{.ReleaseImage}} --format '{{"{{"}} index .RepoDigests 0 {{"}}"}}' ) || [[ -z "${RELEASE_IMAGE_DIGEST}" ]]; then | ||
echo "Warning: Could not resolve release image to pull by digest" 2>&1 | ||
RELEASE_IMAGE_DIGEST="{{.ReleaseImage}}" | ||
fi | ||
|
||
image_for() { | ||
podman run --quiet --rm --net=none "${RELEASE_IMAGE_DIGEST}" image "${1}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
data/data/bootstrap/systemd/units/release-image.service.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Download the OpenShift Release Image | ||
Wants=network-online.target | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/local/bin/release-image-download.sh | ||
RemainAfterExit=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |