Skip to content

Commit 55832cc

Browse files
committed
chore: set kubeconfig when run e2e test
Signed-off-by: ashing <[email protected]>
1 parent 2fbc580 commit 55832cc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ GATEAY_API_VERSION ?= v1.1.0
1515
DASHBOARD_VERSION ?= v3.2.14.6
1616
TEST_TIMEOUT ?= 30m
1717

18+
export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig
19+
1820
# go
1921
VERSYM="github.com/api7/api7-ingress-controller/internal/version._buildVersion"
2022
GITSHASYM="github.com/api7/api7-ingress-controller/internal/version._buildGitRevision"
@@ -87,6 +89,7 @@ kind-e2e-test: kind-up build-image kind-load-images e2e-test
8789
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
8890
.PHONY: e2e-test
8991
e2e-test:
92+
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
9093
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test ./test/e2e/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v
9194

9295
.PHONY: conformance-test
@@ -106,6 +109,7 @@ kind-up:
106109
@kind get clusters 2>&1 | grep -v $(KIND_NAME) \
107110
&& kind create cluster --name $(KIND_NAME) \
108111
|| echo "kind cluster already exists"
112+
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
109113
kubectl wait --for=condition=Ready nodes --all
110114

111115
.PHONY: kind-down

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
gorm.io/gorm v1.25.11
3333
helm.sh/helm/v3 v3.15.4
3434
k8s.io/api v0.31.0
35+
k8s.io/apiextensions-apiserver v0.31.0
3536
k8s.io/apimachinery v0.31.0
3637
k8s.io/client-go v0.31.0
3738
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
@@ -212,7 +213,6 @@ require (
212213
gopkg.in/inf.v0 v0.9.1 // indirect
213214
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
214215
gopkg.in/yaml.v3 v3.0.1 // indirect
215-
k8s.io/apiextensions-apiserver v0.31.0 // indirect
216216
k8s.io/apiserver v0.31.0 // indirect
217217
k8s.io/cli-runtime v0.30.3 // indirect
218218
k8s.io/component-base v0.31.0 // indirect

0 commit comments

Comments
 (0)