From 12a35d3263290dba3dca90b634efe02c24fc7d86 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Tue, 12 Mar 2024 17:09:44 -0700 Subject: [PATCH 1/4] Update node version Signed-off-by: Lubron Zhan --- .github/workflows/actions.yml | 4 ++-- .github/workflows/push.yml | 4 ++-- Makefile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 130bd2ac..4541b6f4 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -27,9 +27,9 @@ jobs: run: cd hack/tools && make golangci-lint - name: Install npm - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '20' - name: Install markdown-lint tool run: npm install -g markdownlint-cli diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4236306e..9d59fec4 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -21,9 +21,9 @@ jobs: run: cd hack/tools && make golangci-lint - name: Install npm - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '20' - name: Install markdown-lint tool run: npm install -g markdownlint-cli diff --git a/Makefile b/Makefile index 4e88fc1e..44bd3915 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,7 @@ lint-markdown: ## Lint the project's markdown ifdef GITHUB_ACTIONS markdownlint -c md-config.json . else - docker run -i --rm -v "$$(pwd)":/work $(CACHE_IMAGE_REGISTRY)/tmknom/markdownlint -c /work/md-config.json . + docker run -i --rm -v "$$(pwd)":/work ghcr.io/tmknom/dockerfiles/markdownlint -c /work/md-config.json . endif .PHONY: lint-shell From 5697b6a6693d6529150dcedcbcb08be8ab33411f Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Tue, 12 Mar 2024 18:00:43 -0700 Subject: [PATCH 2/4] Fix unit test Signed-off-by: Lubron Zhan --- controllers/machine/machine_controller_intg_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/machine/machine_controller_intg_test.go b/controllers/machine/machine_controller_intg_test.go index eb70a0e4..9e0e8b8e 100644 --- a/controllers/machine/machine_controller_intg_test.go +++ b/controllers/machine/machine_controller_intg_test.go @@ -93,10 +93,11 @@ func intgTestMachineController() { }) It("Corresponding Endpoints should be created", func() { ep := &corev1.Endpoints{} - Eventually(func() error { - return ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) - }).Should(Succeed()) Eventually(func() int { + err := ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) + if err != nil { + return 0 + } if len(ep.Subsets) == 0 { return 0 } From b5ea637c4aa9559a9c4c97c4487e3e297ff7cf82 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Tue, 12 Mar 2024 18:33:16 -0700 Subject: [PATCH 3/4] Print log Signed-off-by: Lubron Zhan --- Makefile | 6 ------ controllers/machine/machine_controller_intg_test.go | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 44bd3915..4820c34a 100644 --- a/Makefile +++ b/Makefile @@ -88,13 +88,7 @@ docker-push: # TODO:(xudongl) This is used to silence the ginkgo complain, can be removed once upgrade ginkgo to v2 export ACK_GINKGO_DEPRECATIONS=1.16.4 integration-test: $(GINKGO) $(ETCD) - $(GINKGO) -v controllers/akodeploymentconfig/phases -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../.." - $(GINKGO) -v controllers/akodeploymentconfig/user -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../.." - $(GINKGO) -v controllers/akodeploymentconfig -- -enable-integration-tests -enable-unit-tests=false $(GINKGO) -v controllers/machine -- -enable-integration-tests -enable-unit-tests=false - $(GINKGO) -v controllers/cluster -- -enable-integration-tests -enable-unit-tests=false - $(GINKGO) -v controllers/tests/cluster_for_akodeploymentconfig/default_adc -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../../.." - $(GINKGO) -v controllers/tests/cluster_for_akodeploymentconfig/default_adc_non_empty_selectors -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../../.." .PHONY: kind-e2e-test kind-e2e-test: $(KUSTOMIZE) $(KIND) $(KUBECTL) $(JQ) $(YTT) diff --git a/controllers/machine/machine_controller_intg_test.go b/controllers/machine/machine_controller_intg_test.go index 9e0e8b8e..c2122dcc 100644 --- a/controllers/machine/machine_controller_intg_test.go +++ b/controllers/machine/machine_controller_intg_test.go @@ -4,6 +4,7 @@ package machine_test import ( + "fmt" "os" . "github.com/onsi/ginkgo" @@ -96,11 +97,15 @@ func intgTestMachineController() { Eventually(func() int { err := ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) if err != nil { + fmt.Println("error#############") return 0 } + fmt.Println(ep) if len(ep.Subsets) == 0 { return 0 } + fmt.Println("here????????") + fmt.Println(ep.Subsets[0]) return len(ep.Subsets[0].Addresses) }).Should(Equal(1)) Expect(ep.Subsets[0].Addresses[0].IP).Should(Equal("1.1.1.1")) From 20c756aa820796939066b0175419bc7d0a65a34e Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Tue, 12 Mar 2024 18:42:25 -0700 Subject: [PATCH 4/4] Revert "Print log" This reverts commit b5ea637c4aa9559a9c4c97c4487e3e297ff7cf82. --- Makefile | 6 ++++++ controllers/machine/machine_controller_intg_test.go | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4820c34a..44bd3915 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,13 @@ docker-push: # TODO:(xudongl) This is used to silence the ginkgo complain, can be removed once upgrade ginkgo to v2 export ACK_GINKGO_DEPRECATIONS=1.16.4 integration-test: $(GINKGO) $(ETCD) + $(GINKGO) -v controllers/akodeploymentconfig/phases -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../.." + $(GINKGO) -v controllers/akodeploymentconfig/user -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../.." + $(GINKGO) -v controllers/akodeploymentconfig -- -enable-integration-tests -enable-unit-tests=false $(GINKGO) -v controllers/machine -- -enable-integration-tests -enable-unit-tests=false + $(GINKGO) -v controllers/cluster -- -enable-integration-tests -enable-unit-tests=false + $(GINKGO) -v controllers/tests/cluster_for_akodeploymentconfig/default_adc -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../../.." + $(GINKGO) -v controllers/tests/cluster_for_akodeploymentconfig/default_adc_non_empty_selectors -- -enable-integration-tests -enable-unit-tests=false -root-dir="../../../.." .PHONY: kind-e2e-test kind-e2e-test: $(KUSTOMIZE) $(KIND) $(KUBECTL) $(JQ) $(YTT) diff --git a/controllers/machine/machine_controller_intg_test.go b/controllers/machine/machine_controller_intg_test.go index c2122dcc..9e0e8b8e 100644 --- a/controllers/machine/machine_controller_intg_test.go +++ b/controllers/machine/machine_controller_intg_test.go @@ -4,7 +4,6 @@ package machine_test import ( - "fmt" "os" . "github.com/onsi/ginkgo" @@ -97,15 +96,11 @@ func intgTestMachineController() { Eventually(func() int { err := ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) if err != nil { - fmt.Println("error#############") return 0 } - fmt.Println(ep) if len(ep.Subsets) == 0 { return 0 } - fmt.Println("here????????") - fmt.Println(ep.Subsets[0]) return len(ep.Subsets[0].Addresses) }).Should(Equal(1)) Expect(ep.Subsets[0].Addresses[0].IP).Should(Equal("1.1.1.1"))