From 0e7e025c5997ef4550c1c1420633176f8cac76d3 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Wed, 5 Mar 2025 15:38:06 -0800 Subject: [PATCH] use kube-cross to build kms plugin --- staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile | 5 ++++- test/e2e/testing-manifests/auth/encrypt/run-e2e.sh | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile b/staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile index 179ef178c91..035ccdbb8fa 100644 --- a/staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile +++ b/staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile @@ -12,7 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.24.0-bullseye AS builder +# NOTE: this is just a default placeholder for convenience +# To build this image properly, please invoke test/e2e/testing-manifests/auth/encrypt/run-e2e.sh +ARG BUILDER_IMAGE=golang:latest +FROM $BUILDER_IMAGE AS builder WORKDIR /workspace diff --git a/test/e2e/testing-manifests/auth/encrypt/run-e2e.sh b/test/e2e/testing-manifests/auth/encrypt/run-e2e.sh index 7b605adfa57..78f04ef0c61 100755 --- a/test/e2e/testing-manifests/auth/encrypt/run-e2e.sh +++ b/test/e2e/testing-manifests/auth/encrypt/run-e2e.sh @@ -27,6 +27,7 @@ set -o pipefail KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../../../.. && pwd -P)" source "${KUBE_ROOT}/hack/lib/init.sh" +source "${KUBE_ROOT}/build/common.sh" readonly cluster_name="kms" readonly registry_name="kind-registry" @@ -38,7 +39,8 @@ build_and_push_mock_plugin() { --no-cache \ --platform linux/amd64 \ --output=type=docker \ - --build-arg=GOTOOLCHAIN="${GOTOOLCHAIN}" \ + --build-arg=GOTOOLCHAIN="${GOTOOLCHAIN:?}" \ + --build-arg=BUILDER_IMAGE="${KUBE_CROSS_IMAGE:?}:${KUBE_CROSS_VERSION:?}" \ -t localhost:5000/mock-kms-provider:e2e \ -f staging/src/k8s.io/kms/internal/plugins/_mock/Dockerfile staging/src/k8s.io/ \ --progress=plain;