From f44827c5b5ec5074334a9c8107efbd6d3674feeb Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Mon, 17 Aug 2026 11:08:47 -0700 Subject: [PATCH] hack/microvm-assets: stage assets to rustfs over IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On an IPv6-only cluster the rustfs ClusterIP is a v6 literal, so the endpoint came out as http://fd00:10:96::abcd:9000 — not a valid URL — and micro-VM asset staging failed outright. Bracketing alone is not enough: the botocore vendored into aws-cli 2.17.0 has no IPv6 endpoint validator and rejects a bracketed literal too. Bracket the literal when it contains a colon, and bump this script's aws-cli pin. The rustfs-bucket-init Job addresses rustfs by DNS name and is left alone, so no address family pays for a fresh in-cluster image pull. --- hack/microvm-assets/stage-to-rustfs.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hack/microvm-assets/stage-to-rustfs.sh b/hack/microvm-assets/stage-to-rustfs.sh index e0d3af4a10..75b3a5cf5f 100755 --- a/hack/microvm-assets/stage-to-rustfs.sh +++ b/hack/microvm-assets/stage-to-rustfs.sh @@ -44,9 +44,13 @@ KUBECTL_CONTEXT="${KUBECTL_CONTEXT:-}" KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-${KUBECTL_CONTEXT#kind-}}" KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-kind}" -# Keep in sync with the rustfs-bucket-init Job in -# manifests/ate-install/kind/rustfs.yaml, which creates the bucket we upload into. -AWS_CLI_IMAGE="amazon/aws-cli:2.17.0@sha256:643507c10ada7964ca6157b3d799f030b90577643da9955d319a77399ed80d73" +# Deliberately ahead of the rustfs-bucket-init Job in +# manifests/ate-install/kind/rustfs.yaml, which still pins 2.17.0: the botocore +# vendored into 2.17 has no IPv6 endpoint validator and rejects a bracketed literal +# outright, which is the only endpoint this script can build when IP_FAMILY=ipv6. +# The Job addresses rustfs by DNS name, so it is unaffected and not worth forcing a +# fresh in-cluster pull on every family. Do not go below 2.31 here. +AWS_CLI_IMAGE="amazon/aws-cli:2.31.0@sha256:3b018ce74732c98acf6f1de59b3a89587cb7f9eb6ea0d1447d1779091b2bf057" ASSETS=(cloud-hypervisor virtiofsd vmlinux rootfs.img configuration-clh.toml) @@ -76,7 +80,13 @@ if [[ -z "${NODE}" ]]; then echo "error: no nodes found for kind cluster '${KIND_CLUSTER_NAME}'" >&2 exit 1 fi -ENDPOINT="http://$(run_kubectl get svc rustfs -o jsonpath='{.spec.clusterIP}'):9000" +RUSTFS_IP="$(run_kubectl get svc rustfs -o jsonpath='{.spec.clusterIP}')" +# On an IPv6-only cluster the ClusterIP is a v6 literal, which needs brackets to +# be a URL at all. +if [[ "${RUSTFS_IP}" == *:* ]]; then + RUSTFS_IP="[${RUSTFS_IP}]" +fi +ENDPOINT="http://${RUSTFS_IP}:9000" echo ">> Uploading assets to s3://${BUCKET}/kata-assets/ via ${ENDPOINT} (netns of ${NODE})..." aws_cli() {