From d0ae21df15ad1f853f4b6139a08e57d19c5b7725 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Sun, 19 Nov 2023 14:29:42 +0200 Subject: [PATCH] makefile, test/e2e: parametize KUBECONFIG In order to allow flexibility in the location of the kubeconfig file, updating the test/e2e target. Signed-off-by: Ram Lavi --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d97c4cd6..7ce126b3 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ GO_IMAGE_TAG := 1.19.4-bullseye LINTER_IMAGE_NAME := docker.io/golangci/golangci-lint LINTER_IMAGE_TAG := v1.50.1 +KUBECONFIG ?= $(HOME)/.kube/config PROJECT_WORKING_DIR := /go/src/github.com/kiagnose/kubevirt-realtime-checkup @@ -67,8 +68,9 @@ e2e-test: $(CONTAINER_ENGINE) run --rm \ -v $(PWD):$(PROJECT_WORKING_DIR):Z \ -v $(PWD)/_go-cache:/root/.cache/go-build:Z \ - -v $(HOME)/.kube:/root/.kube:Z \ + -v $(shell dirname $(KUBECONFIG)):/root/.kube:Z,ro \ --workdir $(PROJECT_WORKING_DIR) \ + -e KUBECONFIG=/root/.kube/$(shell basename $(KUBECONFIG)) \ -e TEST_NAMESPACE=$(TEST_NAMESPACE) \ -e TEST_CHECKUP_IMAGE=$(TEST_CHECKUP_IMAGE) \ -e VM_UNDER_TEST_CONTAINER_DISK_IMAGE=$(VM_UNDER_TEST_CONTAINER_DISK_IMAGE) \