@@ -38,7 +38,10 @@ function create_cluster {
3838 kind_config=$( dirname " $0 " ) /kind-config-${version_prefix} .yaml
3939 fi
4040 echo " Creating cluster..."
41- kind create cluster -v 4 --name $KIND_CLUSTER --retain --wait=1m --config ${kind_config} --image=kindest/node:$1
41+ kind create cluster -v 4 --name $KIND_CLUSTER --retain --wait=5m --config ${kind_config} --image=kindest/node:$1
42+
43+ echo " Waiting for cluster to be fully ready..."
44+ kubectl wait --for=condition=Ready nodes --all --timeout=5m
4245 fi
4346}
4447
@@ -58,11 +61,27 @@ function delete_cluster {
5861function test_cluster {
5962 local flags=" $@ "
6063
61- docker pull memcached:1.6.26-alpine3.19
62- kind load docker-image --name $KIND_CLUSTER memcached:1.6.26-alpine3.19
64+ # Detect the platform architecture for the kind cluster
65+ # Kind clusters now run natively on the host architecture (arm64 on Apple Silicon, amd64 on x86)
66+ local kind_platform=" linux/amd64"
67+ if [[ " $OSTYPE " == " darwin" * ]] && [[ " $( uname -m) " == " arm64" ]]; then
68+ kind_platform=" linux/arm64"
69+ elif [[ " $( uname -m) " == " aarch64" ]]; then
70+ kind_platform=" linux/arm64"
71+ fi
72+
73+ # Pull images for the correct platform
74+ docker pull --platform ${kind_platform} memcached:1.6.26-alpine3.19
75+ docker pull --platform ${kind_platform} busybox:1.36.1
6376
64- docker pull busybox:1.36.1
65- kind load docker-image --name $KIND_CLUSTER busybox:1.36.1
77+ # Load images directly with ctr to avoid kind's --all-platforms issue
78+ # kind load docker-image uses --all-platforms internally which breaks with multi-platform manifests
79+ docker save memcached:1.6.26-alpine3.19 | docker exec -i $KIND_CLUSTER -control-plane ctr --namespace=k8s.io images import /dev/stdin
80+
81+ # Busybox has Docker save issues on some platforms, pull directly as fallback
82+ if ! docker save busybox:1.36.1 2> /dev/null | docker exec -i $KIND_CLUSTER -control-plane ctr --namespace=k8s.io images import /dev/stdin 2> /dev/null; then
83+ docker exec $KIND_CLUSTER -control-plane ctr --namespace=k8s.io images pull --platform ${kind_platform} docker.io/library/busybox:1.36.1 > /dev/null 2>&1
84+ fi
6685
6786 go test $( dirname " $0 " ) /deployimage $flags -timeout 30m
6887 go test $( dirname " $0 " ) /v4 $flags -timeout 30m
0 commit comments