diff --git a/cluster/images/conformance/Dockerfile b/cluster/images/conformance/Dockerfile index f1f79d26519..e7785254274 100644 --- a/cluster/images/conformance/Dockerfile +++ b/cluster/images/conformance/Dockerfile @@ -13,16 +13,24 @@ # limitations under the License. ARG BASEIMAGE +ARG RUNNERIMAGE -FROM ${BASEIMAGE} +FROM ${BASEIMAGE} as debbase +FROM ${RUNNERIMAGE} + +# This is a dependency for `kubectl diff` tests +COPY --from=debbase /usr/bin/diff /usr/local/bin/ + +COPY cluster /kubernetes/cluster COPY ginkgo /usr/local/bin/ COPY e2e.test /usr/local/bin/ COPY kubectl /usr/local/bin/ -COPY run_e2e.sh /run_e2e.sh +COPY gorunner /usr/local/bin/kubeconformance + +# Legacy executables -- deprecated +COPY gorunner /run_e2e.sh COPY gorunner /gorunner -COPY cluster /kubernetes/cluster -WORKDIR /usr/local/bin ENV E2E_FOCUS="\[Conformance\]" ENV E2E_SKIP="" @@ -32,4 +40,4 @@ ENV E2E_VERBOSITY="4" ENV RESULTS_DIR="/tmp/results" ENV KUBECONFIG="" -CMD [ "/bin/bash", "-c", "/run_e2e.sh" ] +ENTRYPOINT [ "kubeconformance" ] diff --git a/cluster/images/conformance/Makefile b/cluster/images/conformance/Makefile index fa7e523db88..4931049a98d 100644 --- a/cluster/images/conformance/Makefile +++ b/cluster/images/conformance/Makefile @@ -31,8 +31,18 @@ E2E_GO_RUNNER_BIN?=$(shell test -f $(LOCAL_OUTPUT_PATH)/go-runner && echo $(LOCA CLUSTER_DIR?=$(shell pwd)/../../../cluster/ -BASEIMAGE=debian:stable-slim -TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX) +# This is defined in root Makefile, but some build contexts do not refer to them +KUBE_BASE_IMAGE_REGISTRY?=k8s.gcr.io + +ifeq ($(ARCH),amd64) + BASEIMAGE?=${KUBE_BASE_IMAGE_REGISTRY}/build-image/debian-base:v2.1.3 +else + BASEIMAGE?=${KUBE_BASE_IMAGE_REGISTRY}/build-image/debian-base-${ARCH}:v2.1.3 +endif + +RUNNERIMAGE?=gcr.io/distroless/base:latest + +TEMP_DIR:=$(shell mktemp -d -t conformance-XXXXXX) all: build @@ -60,6 +70,7 @@ endif --pull \ -t ${REGISTRY}/conformance-${ARCH}:${VERSION} \ --build-arg BASEIMAGE=$(BASEIMAGE) \ + --build-arg RUNNERIMAGE=$(RUNNERIMAGE) \ ${TEMP_DIR} rm -rf "${TEMP_DIR}" diff --git a/cluster/images/conformance/go-runner/e2erunner.go b/cluster/images/conformance/go-runner/main.go similarity index 93% rename from cluster/images/conformance/go-runner/e2erunner.go rename to cluster/images/conformance/go-runner/main.go index 073b3159c0f..f96bd7aa540 100644 --- a/cluster/images/conformance/go-runner/e2erunner.go +++ b/cluster/images/conformance/go-runner/main.go @@ -23,11 +23,15 @@ import ( "os" "os/signal" "path/filepath" + "strings" "github.com/pkg/errors" ) func main() { + if strings.Contains(os.Args[0], "run_e2e.sh") || strings.Contains(os.Args[0], "gorunner") { + log.Print("warn: calling test with e2e.test is deprecated and will be removed in 1.25, please rely on container manifest to invoke executable") + } env := envWithDefaults(map[string]string{ resultsDirEnvKey: defaultResultsDir, skipEnvKey: defaultSkip,