Skip to content

Commit a03cadf

Browse files
committed
scripts: Pre-pull extra approved images
Some integration tests might run on more approved images. Find which it is based on the test file then pre-pull it. Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com> Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 988d76d commit a03cadf

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

scripts/pre-pull-images.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,27 @@
44
#
55
# SPDX-License-Identifier: CC0-1.0
66

7+
secondary_approved_image() {
8+
sed -nE 's/const COMBINE_PCRS_UPDATE_TEST_IMAGE: &str = "(.*)";/\1/p' tests/trusted_execution_cluster.rs
9+
}
710

811
## Special handling for the approved image because of the kind issue with
912
## loading images used by image volumes. See:
1013
## https://github.com/kubernetes-sigs/kind/issues/4099
11-
LOCAL_APPROVED_IMAGE=localhost:5000/approved-image:latest
12-
docker pull $APPROVED_IMAGE
13-
docker tag $APPROVED_IMAGE $LOCAL_APPROVED_IMAGE
14-
docker push $LOCAL_APPROVED_IMAGE
15-
docker exec -ti kind-control-plane crictl pull $LOCAL_APPROVED_IMAGE
14+
pull_approved_image() {
15+
local image=$1
16+
local index=$2
17+
local local_image="localhost:5000/approved-image-${index}:latest"
18+
echo "Pulling approved image: $image"
19+
docker pull "$image"
20+
docker tag "$image" "$local_image"
21+
docker push "$local_image"
22+
docker exec -ti kind-control-plane crictl pull "$local_image"
23+
echo "-------------------------------"
24+
}
25+
26+
pull_approved_image "$APPROVED_IMAGE" 0
27+
pull_approved_image "$(secondary_approved_image)" 1
1628

1729
KV_VERSION=v1.7.0
1830
IMAGES=(

0 commit comments

Comments
 (0)