Skip to content

Commit b074fc5

Browse files
ci(e2e): preload a fixed list of Calico images
Name the three Calico images instead of extracting them from the manifest, and define the Calico version once for both the manifest URL and the image tags. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent 1501e07 commit b074fc5

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎.github/actions/setup-e2e-kind/action.yml‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ runs:
7878
shell: bash
7979
env:
8080
CLUSTER_NAME: ${{ inputs.cluster-name }}
81+
CALICO_VERSION: v3.30.3
8182
run: |
8283
set -euo pipefail
8384
collect_cni_diagnostics() {
@@ -98,18 +99,14 @@ runs:
9899
exit "$failure_status"
99100
}
100101
trap collect_cni_diagnostics ERR
101-
curl -fsSL https://raw.githubusercontent.com/projectcalico/calico/v3.30.3/manifests/calico.yaml \
102+
curl -fsSL "https://raw.githubusercontent.com/projectcalico/calico/$CALICO_VERSION/manifests/calico.yaml" \
102103
-o "$RUNNER_TEMP/calico.yaml"
103104
sed 's@192.168.0.0/16@10.244.0.0/16@g' "$RUNNER_TEMP/calico.yaml" > "$RUNNER_TEMP/calico-kind.yaml"
104105
# The kind node's containerd pulls Docker Hub anonymously and is rate
105106
# limited. The host daemon pulls through the runner's registry mirror.
106-
calico_images=$(sed -nE 's/^[[:space:]]*image:[[:space:]]*"?([^"[:space:]]+)"?.*/\1/p' "$RUNNER_TEMP/calico-kind.yaml" | sort -u)
107-
if [ -z "$calico_images" ]; then
108-
echo "ERROR: no images found in the Calico manifest" >&2
109-
exit 1
110-
fi
111-
for image in $calico_images; do
112-
archive="$RUNNER_TEMP/calico-$(basename "${image%%:*}")-linux-amd64.tar"
107+
for component in cni node kube-controllers; do
108+
image="docker.io/calico/$component:$CALICO_VERSION"
109+
archive="$RUNNER_TEMP/calico-$component-linux-amd64.tar"
113110
docker pull --platform linux/amd64 "$image"
114111
docker image save --platform linux/amd64 --output "$archive" "$image"
115112
kind load image-archive "$archive" --name "$CLUSTER_NAME"

0 commit comments

Comments
 (0)