From 70de9fbb96d2e73a06ba927abaeefb0e16b01407 Mon Sep 17 00:00:00 2001
From: Lubron <lzhan@vmware.com>
Date: Wed, 13 Mar 2024 10:33:34 -0700
Subject: [PATCH] Update node version, and change base image of markdownlint
 (#182)

* Update node version
* Improve integration test
* change base image of markdownlint to not to pull from docker

---------

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
---
 .github/workflows/actions.yml                     |  4 ++--
 .github/workflows/push.yml                        |  4 ++--
 Makefile                                          |  2 +-
 .../machine/machine_controller_intg_test.go       | 15 +++++++++------
 4 files changed, 14 insertions(+), 11 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
diff --git a/controllers/machine/machine_controller_intg_test.go b/controllers/machine/machine_controller_intg_test.go
index e3979e3f..9e0e8b8e 100644
--- a/controllers/machine/machine_controller_intg_test.go
+++ b/controllers/machine/machine_controller_intg_test.go
@@ -93,13 +93,16 @@ func intgTestMachineController() {
 			})
 			It("Corresponding Endpoints should be created", func() {
 				ep := &corev1.Endpoints{}
-				Eventually(func() bool {
+				Eventually(func() int {
 					err := ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep)
-					return err == nil
-				}).Should(BeTrue())
-				Expect(ep.Subsets).ShouldNot(BeNil())
-				Expect(ep.Subsets[0].Addresses).ShouldNot(BeNil())
-				Expect(len(ep.Subsets[0].Addresses)).Should(Equal(1))
+					if err != nil {
+						return 0
+					}
+					if len(ep.Subsets) == 0 {
+						return 0
+					}
+					return len(ep.Subsets[0].Addresses)
+				}).Should(Equal(1))
 				Expect(ep.Subsets[0].Addresses[0].IP).Should(Equal("1.1.1.1"))
 			})
 			It("Should add one more machine", func() {