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 bf3e707b [horus] Define the reboot host username and password (#415)
bf3e707b is described below

commit bf3e707b2ea2231069e44ea0d9e8d3e9fbc0bdbe
Author: mfordjody <[email protected]>
AuthorDate: Wed Oct 2 09:09:59 2024 +0800

    [horus] Define the reboot host username and password (#415)
---
 app/horus/basic/config/file.go         | 2 ++
 app/horus/core/horuser/node_restart.go | 8 +++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/horus/basic/config/file.go b/app/horus/basic/config/file.go
index 28af1ba5..2a625d28 100644
--- a/app/horus/basic/config/file.go
+++ b/app/horus/basic/config/file.go
@@ -73,6 +73,8 @@ type DowntimeConfiguration struct {
        KubeMultiple         map[string]string      `yaml:"kubeMultiple"`
        AbnormalityQL        []string               `yaml:"abnormalityQL"`
        AbnormalInfoSystemQL string                 
`yaml:"abnormalInfoSystemQL"`
+       AllSystemUser        string                 `yaml:"allSystemUser"`
+       AllSystemPassword    string                 `yaml:"allSystemPassword"`
        DingTalk             *DingTalkConfiguration `yaml:"dingTalk"`
 }
 
diff --git a/app/horus/core/horuser/node_restart.go 
b/app/horus/core/horuser/node_restart.go
index e24ea2f1..fe7c8549 100644
--- a/app/horus/core/horuser/node_restart.go
+++ b/app/horus/core/horuser/node_restart.go
@@ -67,14 +67,12 @@ func (h *Horuser) TryRestart(node db.NodeDataInfo) {
        if pass {
                msg := 
fmt.Sprintf("\n【等待宕机节点腾空后重启】\n【节点:%v】\n【日期:%v】\n【集群:%v】\n", node.NodeName, 
node.FirstDate, node.ClusterName)
                alert.DingTalkSend(h.cc.NodeDownTime.DingTalk, msg)
-               // TODO user@password
-               cmd := exec.Command("/bin/bash", "./restart.sh", node.NodeIP)
+               cmd := exec.Command("/bin/bash", "./restart.sh", node.NodeIP, 
h.cc.NodeDownTime.AllSystemUser, h.cc.NodeDownTime.AllSystemPassword)
                output, err := cmd.CombinedOutput()
                if err != nil {
-                       klog.Errorf("Failed to execute restart.sh script for 
node %v: %v", node.NodeName, err)
-                       klog.Errorf("Output: %v", string(output))
+                       klog.Errorf("Failed restart for Output: %v node %v: 
%v", string(output), node.NodeName, err)
                        return
                }
-               klog.Infof("Successfully executed restart.sh for node %v. 
Output: %v", node.NodeName, string(output))
+               klog.Infof("Successfully restart for node %v. Output: %v", 
node.NodeName, string(output))
        }
 }

Reply via email to