Skip to content

Commit 78e009f

Browse files
committed
feat(makefile): support dynamic Kind cluster naming
change KIND_CLUSTER_NAME to KIND_CLUSTER to follow e2e test suite setup, which utilizes the env variable KIND_CLUSTER.
1 parent bc64f91 commit 78e009f

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

docs/book/src/cronjob-tutorial/testdata/project/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6969
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
7070
# CertManager is installed by default; skip with:
7171
# - CERT_MANAGER_INSTALL_SKIP=true
72-
KIND_CLUSTER_NAME ?= kind
72+
KIND_CLUSTER ?= kind
7373
.PHONY: test-e2e
7474
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7575
@command -v $(KIND) >/dev/null 2>&1 || { \
7676
echo "Kind is not installed. Please install Kind manually."; \
7777
exit 1; \
7878
}
79-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
79+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
8080
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
8181
exit 1; \
8282
}
83-
go test ./test/e2e/ -v -ginkgo.v
83+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8484

8585
.PHONY: lint
8686
lint: golangci-lint ## Run golangci-lint linter

docs/book/src/getting-started/testdata/project/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
6666
# CertManager is installed by default; skip with:
6767
# - CERT_MANAGER_INSTALL_SKIP=true
68-
KIND_CLUSTER_NAME ?= kind
68+
KIND_CLUSTER ?= kind
6969
.PHONY: test-e2e
7070
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7171
@command -v $(KIND) >/dev/null 2>&1 || { \
7272
echo "Kind is not installed. Please install Kind manually."; \
7373
exit 1; \
7474
}
75-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
75+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
7676
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
7777
exit 1; \
7878
}
79-
go test ./test/e2e/ -v -ginkgo.v
79+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8080

8181
.PHONY: lint
8282
lint: golangci-lint ## Run golangci-lint linter

docs/book/src/multiversion-tutorial/testdata/project/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6969
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
7070
# CertManager is installed by default; skip with:
7171
# - CERT_MANAGER_INSTALL_SKIP=true
72-
KIND_CLUSTER_NAME ?= kind
72+
KIND_CLUSTER ?= kind
7373
.PHONY: test-e2e
7474
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7575
@command -v $(KIND) >/dev/null 2>&1 || { \
7676
echo "Kind is not installed. Please install Kind manually."; \
7777
exit 1; \
7878
}
79-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
79+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
8080
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
8181
exit 1; \
8282
}
83-
go test ./test/e2e/ -v -ginkgo.v
83+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8484

8585
.PHONY: lint
8686
lint: golangci-lint ## Run golangci-lint linter

pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
144144
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
145145
# CertManager is installed by default; skip with:
146146
# - CERT_MANAGER_INSTALL_SKIP=true
147-
KIND_CLUSTER_NAME ?= kind
147+
KIND_CLUSTER ?= kind
148148
.PHONY: test-e2e
149149
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
150150
@command -v $(KIND) >/dev/null 2>&1 || { \
151151
echo "Kind is not installed. Please install Kind manually."; \
152152
exit 1; \
153153
}
154-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
154+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
155155
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
156156
exit 1; \
157157
}
158-
go test ./test/e2e/ -v -ginkgo.v
158+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
159159
160160
.PHONY: lint
161161
lint: golangci-lint ## Run golangci-lint linter

testdata/project-v4-multigroup/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
6666
# CertManager is installed by default; skip with:
6767
# - CERT_MANAGER_INSTALL_SKIP=true
68-
KIND_CLUSTER_NAME ?= kind
68+
KIND_CLUSTER ?= kind
6969
.PHONY: test-e2e
7070
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7171
@command -v $(KIND) >/dev/null 2>&1 || { \
7272
echo "Kind is not installed. Please install Kind manually."; \
7373
exit 1; \
7474
}
75-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
75+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
7676
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
7777
exit 1; \
7878
}
79-
go test ./test/e2e/ -v -ginkgo.v
79+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8080

8181
.PHONY: lint
8282
lint: golangci-lint ## Run golangci-lint linter

testdata/project-v4-with-plugins/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
6666
# CertManager is installed by default; skip with:
6767
# - CERT_MANAGER_INSTALL_SKIP=true
68-
KIND_CLUSTER_NAME ?= kind
68+
KIND_CLUSTER ?= kind
6969
.PHONY: test-e2e
7070
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7171
@command -v $(KIND) >/dev/null 2>&1 || { \
7272
echo "Kind is not installed. Please install Kind manually."; \
7373
exit 1; \
7474
}
75-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
75+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
7676
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
7777
exit 1; \
7878
}
79-
go test ./test/e2e/ -v -ginkgo.v
79+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8080

8181
.PHONY: lint
8282
lint: golangci-lint ## Run golangci-lint linter

testdata/project-v4/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
6666
# CertManager is installed by default; skip with:
6767
# - CERT_MANAGER_INSTALL_SKIP=true
68-
KIND_CLUSTER_NAME ?= kind
68+
KIND_CLUSTER ?= kind
6969
.PHONY: test-e2e
7070
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
7171
@command -v $(KIND) >/dev/null 2>&1 || { \
7272
echo "Kind is not installed. Please install Kind manually."; \
7373
exit 1; \
7474
}
75-
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER_NAME)' || { \
75+
@$(KIND) get clusters | grep -q '$(KIND_CLUSTER)' || { \
7676
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
7777
exit 1; \
7878
}
79-
go test ./test/e2e/ -v -ginkgo.v
79+
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
8080

8181
.PHONY: lint
8282
lint: golangci-lint ## Run golangci-lint linter

0 commit comments

Comments
 (0)