From 25b4eb63d90aef6213147e89fc7943b1f58eef64 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Fri, 15 May 2026 15:52:51 -0400 Subject: [PATCH] Switch e2e tests to build kind node images from release artifacts Instead of pulling pre-built kindest/node images from Docker Hub, build them locally using "kind build node-image". This downloads K8s release tarballs rather than compiling from source, so the cost is comparable to pulling the pre-built image. This gives kueue control over e2e testing timing without relying on kind to publish official node images for each K8s release. In dev mode, the build is skipped when the image already exists locally. Non-standard images (e.g. k8s-main:latest) are also skipped since they have their own build targets. --- hack/testing/e2e-common.sh | 15 +++++++++++++++ hack/testing/e2e-multikueue-test.sh | 3 ++- hack/testing/e2e-test.sh | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hack/testing/e2e-common.sh b/hack/testing/e2e-common.sh index f9ff8157ae4..7d18cbe27a5 100644 --- a/hack/testing/e2e-common.sh +++ b/hack/testing/e2e-common.sh @@ -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 + 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" +} + function e2e_is_truthy { case "${1:-}" in 1|true|TRUE|True|yes|YES|Yes|y|Y|on|ON|On) return 0 ;; diff --git a/hack/testing/e2e-multikueue-test.sh b/hack/testing/e2e-multikueue-test.sh index e608e9f0f09..5d2950439e5 100755 --- a/hack/testing/e2e-multikueue-test.sh +++ b/hack/testing/e2e-multikueue-test.sh @@ -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; } diff --git a/hack/testing/e2e-test.sh b/hack/testing/e2e-test.sh index 43d2e592f6b..a59b13a4f0d 100755 --- a/hack/testing/e2e-test.sh +++ b/hack/testing/e2e-test.sh @@ -48,6 +48,7 @@ function startup { } trap cleanup EXIT +build_kind_node_image startup & prepare_docker_images wait