Allow to use a custom k8s version in e2e tests
This commit is contained in:
parent
87b730d5fe
commit
d32079e69c
3 changed files with 20 additions and 15 deletions
14
Makefile
14
Makefile
|
@ -12,13 +12,6 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Running make run-in-docker allows the execution of a target
|
|
||||||
# using a container intead of running the command locally
|
|
||||||
ifeq (run-in-docker,$(firstword $(MAKECMDGOALS)))
|
|
||||||
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
|
||||||
$(eval $(RUN_ARGS):;@:)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: all-container
|
all: all-container
|
||||||
|
|
||||||
|
@ -36,6 +29,7 @@ FOCUS ?= .*
|
||||||
E2E_NODES ?= 10
|
E2E_NODES ?= 10
|
||||||
# slow test only if takes > 50s
|
# slow test only if takes > 50s
|
||||||
SLOW_E2E_THRESHOLD ?= 50
|
SLOW_E2E_THRESHOLD ?= 50
|
||||||
|
K8S_VERSION ?= v1.14.1
|
||||||
|
|
||||||
ifeq ($(GOHOSTOS),darwin)
|
ifeq ($(GOHOSTOS),darwin)
|
||||||
SED_I=sed -i ''
|
SED_I=sed -i ''
|
||||||
|
@ -59,12 +53,14 @@ QEMUVERSION = v4.0.0
|
||||||
BUSTED_ARGS =-v --pattern=_test
|
BUSTED_ARGS =-v --pattern=_test
|
||||||
|
|
||||||
export ARCH
|
export ARCH
|
||||||
|
export DUMB_ARCH
|
||||||
export TAG
|
export TAG
|
||||||
export PKG
|
export PKG
|
||||||
export GOARCH
|
export GOARCH
|
||||||
export GIT_COMMIT
|
export GIT_COMMIT
|
||||||
export GOBUILD_FLAGS
|
export GOBUILD_FLAGS
|
||||||
export REPO_INFO
|
export REPO_INFO
|
||||||
|
export BUSTED_ARGS
|
||||||
|
|
||||||
IMGNAME = nginx-ingress-controller
|
IMGNAME = nginx-ingress-controller
|
||||||
IMAGE = $(REGISTRY)/$(IMGNAME)
|
IMAGE = $(REGISTRY)/$(IMGNAME)
|
||||||
|
@ -252,7 +248,3 @@ misspell:
|
||||||
.PHONE: kind-e2e-test
|
.PHONE: kind-e2e-test
|
||||||
kind-e2e-test:
|
kind-e2e-test:
|
||||||
test/e2e/run.sh
|
test/e2e/run.sh
|
||||||
|
|
||||||
.PHONE: run-in-docker
|
|
||||||
run-in-docker:
|
|
||||||
# dummy target
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ docker run \
|
||||||
${MINIKUBE_VOLUME} \
|
${MINIKUBE_VOLUME} \
|
||||||
-w /go/src/${PKG} \
|
-w /go/src/${PKG} \
|
||||||
--env-file .env \
|
--env-file .env \
|
||||||
--entrypoint ${FLAGS} \
|
${E2E_IMAGE} ${FLAGS}
|
||||||
${E2E_IMAGE}
|
|
||||||
|
|
||||||
rm .env
|
rm .env
|
|
@ -14,8 +14,11 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
KIND_LOG_LEVEL="info"
|
||||||
|
|
||||||
if ! [ -z $DEBUG ]; then
|
if ! [ -z $DEBUG ]; then
|
||||||
set -x
|
set -x
|
||||||
|
KIND_LOG_LEVEL="debug"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
@ -28,12 +31,19 @@ export TAG=dev
|
||||||
export ARCH=amd64
|
export ARCH=amd64
|
||||||
export REGISTRY=ingress-controller
|
export REGISTRY=ingress-controller
|
||||||
|
|
||||||
|
export K8S_VERSION=${K8S_VERSION:-v1.14.1}
|
||||||
|
|
||||||
KIND_CLUSTER_NAME="ingress-nginx-dev"
|
KIND_CLUSTER_NAME="ingress-nginx-dev"
|
||||||
|
|
||||||
kind --version || $(echo "Please install kind before running e2e tests";exit 1)
|
kind --version || $(echo "Please install kind before running e2e tests";exit 1)
|
||||||
|
|
||||||
echo "[dev-env] creating Kubernetes cluster with kind"
|
echo "[dev-env] creating Kubernetes cluster with kind"
|
||||||
kind create cluster --name ${KIND_CLUSTER_NAME} --config ${DIR}/kind.yaml
|
# TODO: replace the custom images after https://github.com/kubernetes-sigs/kind/issues/531
|
||||||
|
kind create cluster \
|
||||||
|
--loglevel=${KIND_LOG_LEVEL} \
|
||||||
|
--name ${KIND_CLUSTER_NAME} \
|
||||||
|
--config ${DIR}/kind.yaml \
|
||||||
|
--image "aledbf/kind-node:${K8S_VERSION}"
|
||||||
|
|
||||||
export KUBECONFIG="$(kind get kubeconfig-path --name="${KIND_CLUSTER_NAME}")"
|
export KUBECONFIG="$(kind get kubeconfig-path --name="${KIND_CLUSTER_NAME}")"
|
||||||
|
|
||||||
|
@ -52,3 +62,7 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/nginx-ingress-c
|
||||||
|
|
||||||
echo "[dev-env] running e2e tests..."
|
echo "[dev-env] running e2e tests..."
|
||||||
make -C ${DIR}/../../ e2e-test
|
make -C ${DIR}/../../ e2e-test
|
||||||
|
|
||||||
|
kind delete cluster \
|
||||||
|
--loglevel=${KIND_LOG_LEVEL} \
|
||||||
|
--name ${KIND_CLUSTER_NAME}
|
||||||
|
|
Loading…
Reference in a new issue