From 0b5b6c21439ab6aa09d7064a3988ee61154e8cf2 Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Wed, 21 Feb 2024 00:19:51 +0530 Subject: [PATCH] using manual command for rke2 service restarts (#60) Signed-off-by: Piyush Kumar --- Earthfile | 2 +- main.go | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Earthfile b/Earthfile index 2399544..4ef6a66 100644 --- a/Earthfile +++ b/Earthfile @@ -43,7 +43,7 @@ BUILD_GOLANG: RUN assert-fips.sh ${BIN} RUN assert-static.sh ${BIN} ELSE - RUN go-build.sh -a -o ${BIN} ./${SRC} + RUN go-build-static.sh -a -o ${BIN} ./${SRC} END SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN} diff --git a/main.go b/main.go index 01e5019..911d52d 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ const ( serverSystemName = "rke2-server" agentSystemName = "rke2-agent" - K8S_NO_PROXY = ".svc,.svc.cluster,.svc.cluster.local" + K8SNoProxy = ".svc,.svc.cluster,.svc.cluster.local" localImagesPath = "/opt/content/images" ) @@ -89,7 +89,7 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig { stages := []yip.Stage{ { - Name: " Install RKE2 Configuration Files", + Name: "Install RKE2 Configuration Files", Files: files, Commands: []string{ @@ -121,13 +121,9 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig { }, yip.Stage{ Name: "Enable Systemd Services", - Systemctl: yip.Systemctl{ - Enable: []string{ - systemName, - }, - Start: []string{ - systemName, - }, + Commands: []string{ + fmt.Sprintf("systemctl enable %s", systemName), + fmt.Sprintf("systemctl restart %s", systemName), }, }) @@ -199,7 +195,7 @@ func getDefaultNoProxy(userOptions []byte) string { if len(serviceCIDR) > 0 { noProxy = noProxy + "," + serviceCIDR } - noProxy = noProxy + "," + getNodeCIDR() + "," + K8S_NO_PROXY + noProxy = noProxy + "," + getNodeCIDR() + "," + K8SNoProxy } return noProxy