From fb59a7e0a9af8b7dc3535f46f992adcf714ea76e Mon Sep 17 00:00:00 2001 From: Hidden Marten Date: Tue, 11 Jun 2024 19:47:25 +0200 Subject: [PATCH] [232] Update variable name --- .github/workflows/make-test-e2e.yaml | 2 +- .github/workflows/make-test.yaml | 2 +- Makefile | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/make-test-e2e.yaml b/.github/workflows/make-test-e2e.yaml index 2b28c502..be893e81 100644 --- a/.github/workflows/make-test-e2e.yaml +++ b/.github/workflows/make-test-e2e.yaml @@ -38,5 +38,5 @@ jobs: # For latest version use default from Makefile make test-e2e else - ENVTEST_K8S_VERSION=${{ matrix.k8s.version }} make test-e2e + K8S_VERSION=${{ matrix.k8s.version }} make test-e2e fi diff --git a/.github/workflows/make-test.yaml b/.github/workflows/make-test.yaml index b1b97300..38549f38 100644 --- a/.github/workflows/make-test.yaml +++ b/.github/workflows/make-test.yaml @@ -32,5 +32,5 @@ jobs: # For latest version use default from Makefile make test else - ENVTEST_K8S_VERSION=${{ matrix.k8s.version }} make test + K8S_VERSION=${{ matrix.k8s.version }} make test fi diff --git a/Makefile b/Makefile index 8575bf1d..bfcf21d9 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Image URL to use all building/pushing image targets IMG ?= ghcr.io/aenix-io/etcd-operator:latest -# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. +# K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. # renovate: datasource=github-tags depName=kubernetes/kubernetes -ENVTEST_K8S_VERSION ?= v1.30.0 -ENVTEST_K8S_VERSION_TRIMMED_V = $(subst v,,$(ENVTEST_K8S_VERSION)) +K8S_VERSION ?= v1.30.0 +K8S_VERSION_TRIMMED_V = $(subst v,,$(K8S_VERSION)) # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -74,9 +74,9 @@ mod-tidy: ## Run go mod tidy against code. .PHONY: test test: manifests generate fmt vet envtest ## Run tests. - echo "Check for kubernetes version $(ENVTEST_K8S_VERSION_TRIMMED_V) in $(ENVTEST)" - @$(ENVTEST) list | grep -q $(ENVTEST_K8S_VERSION_TRIMMED_V) - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION_TRIMMED_V) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out + echo "Check for kubernetes version $(K8S_VERSION_TRIMMED_V) in $(ENVTEST)" + @$(ENVTEST) list | grep -q $(K8S_VERSION_TRIMMED_V) + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(K8S_VERSION_TRIMMED_V) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out # Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors. .PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up. @@ -200,11 +200,11 @@ kind-load: docker-build kind ## Build and upload docker image to the local Kind .PHONY: kind-create kind-create: kind yq ## Create kubernetes cluster using Kind. @if ! $(KIND) get clusters | grep -q $(KIND_CLUSTER_NAME); then \ - $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image kindest/node:$(ENVTEST_K8S_VERSION); \ + $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image kindest/node:$(K8S_VERSION); \ fi - @if ! $(CONTAINER_TOOL) container inspect $$($(KIND) get nodes) | $(YQ) e '.[0].Config.Image' | grep -q $(ENVTEST_K8S_VERSION); then \ + @if ! $(CONTAINER_TOOL) container inspect $$($(KIND) get nodes) | $(YQ) e '.[0].Config.Image' | grep -q $(K8S_VERSION); then \ $(KIND) delete cluster --name $(KIND_CLUSTER_NAME); \ - $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image kindest/node:$(ENVTEST_K8S_VERSION); \ + $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image kindest/node:$(K8S_VERSION); \ fi .PHONY: kind-delete