mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Merge pull request #99178 from wilsonehusin/distroless-conformance
Use distroless to build Conformance image
This commit is contained in:
commit
fb3273774a
@ -13,16 +13,24 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ARG BASEIMAGE
|
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 ginkgo /usr/local/bin/
|
||||||
COPY e2e.test /usr/local/bin/
|
COPY e2e.test /usr/local/bin/
|
||||||
COPY kubectl /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 gorunner /gorunner
|
||||||
COPY cluster /kubernetes/cluster
|
|
||||||
WORKDIR /usr/local/bin
|
|
||||||
|
|
||||||
ENV E2E_FOCUS="\[Conformance\]"
|
ENV E2E_FOCUS="\[Conformance\]"
|
||||||
ENV E2E_SKIP=""
|
ENV E2E_SKIP=""
|
||||||
@ -32,4 +40,4 @@ ENV E2E_VERBOSITY="4"
|
|||||||
ENV RESULTS_DIR="/tmp/results"
|
ENV RESULTS_DIR="/tmp/results"
|
||||||
ENV KUBECONFIG=""
|
ENV KUBECONFIG=""
|
||||||
|
|
||||||
CMD [ "/bin/bash", "-c", "/run_e2e.sh" ]
|
ENTRYPOINT [ "kubeconformance" ]
|
||||||
|
@ -31,8 +31,18 @@ E2E_GO_RUNNER_BIN?=$(shell test -f $(LOCAL_OUTPUT_PATH)/go-runner && echo $(LOCA
|
|||||||
|
|
||||||
CLUSTER_DIR?=$(shell pwd)/../../../cluster/
|
CLUSTER_DIR?=$(shell pwd)/../../../cluster/
|
||||||
|
|
||||||
BASEIMAGE=debian:stable-slim
|
# This is defined in root Makefile, but some build contexts do not refer to them
|
||||||
TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX)
|
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
|
all: build
|
||||||
|
|
||||||
@ -60,6 +70,7 @@ endif
|
|||||||
--pull \
|
--pull \
|
||||||
-t ${REGISTRY}/conformance-${ARCH}:${VERSION} \
|
-t ${REGISTRY}/conformance-${ARCH}:${VERSION} \
|
||||||
--build-arg BASEIMAGE=$(BASEIMAGE) \
|
--build-arg BASEIMAGE=$(BASEIMAGE) \
|
||||||
|
--build-arg RUNNERIMAGE=$(RUNNERIMAGE) \
|
||||||
${TEMP_DIR}
|
${TEMP_DIR}
|
||||||
rm -rf "${TEMP_DIR}"
|
rm -rf "${TEMP_DIR}"
|
||||||
|
|
||||||
|
@ -23,11 +23,15 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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{
|
env := envWithDefaults(map[string]string{
|
||||||
resultsDirEnvKey: defaultResultsDir,
|
resultsDirEnvKey: defaultResultsDir,
|
||||||
skipEnvKey: defaultSkip,
|
skipEnvKey: defaultSkip,
|
Loading…
Reference in New Issue
Block a user