Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hack/testing/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ export E2E_SKIP_IMAGE_RELOAD="${E2E_SKIP_IMAGE_RELOAD:-false}"

export KIND_VERSION="${E2E_KIND_VERSION/"kindest/node:v"/}"

function build_kind_node_image {
if [[ "$E2E_KIND_VERSION" != kindest/node:v* ]]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo "Skipping kind node image build for non-standard image: $E2E_KIND_VERSION"
return 0
fi

if [[ "${E2E_MODE}" == "dev" ]] && docker image inspect "$E2E_KIND_VERSION" &>/dev/null; then
echo "Reusing existing node image: $E2E_KIND_VERSION (E2E_MODE=dev)"
return 0
fi

echo "Building kind node image: $E2E_KIND_VERSION (K8s v$KIND_VERSION)"
$KIND build node-image "v$KIND_VERSION" --image "$E2E_KIND_VERSION"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much longer does it take compared to just downloading it? I’m wondering if we can first check whether the image already exists, and only build it if it doesn’t.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way you have to download the base image layer (squashed) and the kubernetes binaries (Either via a node-image or via the release tarball) so it's similar.

}

function e2e_is_truthy {
case "${1:-}" in
1|true|TRUE|True|yes|YES|Yes|y|Y|on|ON|On) return 0 ;;
Expand Down
3 changes: 2 additions & 1 deletion hack/testing/e2e-multikueue-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ function kueue_deploy {
}

trap cleanup EXIT
startup
build_kind_node_image
startup
prepare_docker_images
for job in $(jobs -p); do
wait "$job" || { echo "Cluster creation failed!"; exit 1; }
Expand Down
1 change: 1 addition & 0 deletions hack/testing/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function startup {
}

trap cleanup EXIT
build_kind_node_image
startup &
prepare_docker_images
wait
Expand Down