You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2024/09/26 13:12:54 UTC

(dubbo-kubernetes) branch master updated: [horus] Reworking the logic (#383)

This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a85ee9c [horus] Reworking the logic (#383)
2a85ee9c is described below

commit 2a85ee9c5fbaeb8f822e4c36a640feb55df42625
Author: mfordjody <11...@qq.com>
AuthorDate: Thu Sep 26 21:12:48 2024 +0800

    [horus] Reworking the logic (#383)
---
 app/horus/core/horuser/node_restart.go | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/app/horus/core/horuser/node_restart.go b/app/horus/core/horuser/node_restart.go
index 6340e7bc..fd232d4c 100644
--- a/app/horus/core/horuser/node_restart.go
+++ b/app/horus/core/horuser/node_restart.go
@@ -52,22 +52,22 @@ func (h *Horuser) RestartOrRepair(ctx context.Context) {
 }
 
 func (h *Horuser) TryRestart(node db.NodeDataInfo) {
-	msg := fmt.Sprintf("\n【节点尝试重启】\n 节点:%v\n 日期:%v\n 集群:%v\n", node.NodeName, node.FirstDate, node.ClusterName)
-
 	err := h.Drain(node.NodeName, node.ClusterName)
 	if err != nil {
-		msg += fmt.Sprintf("\n【驱逐节点】\n")
+		msg += fmt.Sprintf("\n【安全驱逐节点尝试重启就绪:%v】\n", err)
 		alert.DingTalkSend(h.cc.NodeDownTime.DingTalk, msg)
+		return
 	}
+	msg := fmt.Sprintf("\n【节点正在尝试重启】\n 节点:%v\n 日期:%v\n 集群:%v\n", node.NodeName, node.FirstDate, node.ClusterName)
 
-	//err := h.UnCordon(node.NodeName, node.ClusterName)
-	//if err != nil {
-	//	msg += fmt.Sprintf("\n【取消不可调度状态失败:%v】\n", err)
-	//	alert.DingTalkSend(h.cc.NodeDownTime.DingTalk, msg)
-	//	return
-	//} else {
-	//	klog.Infof("Node %v is already uncordoned.", node.NodeName)
-	//}
+	err := h.UnCordon(node.NodeName, node.ClusterName)
+	if err != nil {
+		msg += fmt.Sprintf("\n【取消不可调度状态失败:%v】\n", err)
+		alert.DingTalkSend(h.cc.NodeDownTime.DingTalk, msg)
+		return
+	} else {
+		klog.Infof("Node %v is already uncordoned.", node.NodeName)
+	}
 
 	err = syscall.Reboot(syscall.LINUX_REBOOT_CMD_RESTART)
 	if err != nil {