From cfba21762dc5320a84b13ec69ad863fd5d0e8e3b Mon Sep 17 00:00:00 2001 From: Yujie-Xie <1398010062@qq.com> Date: Mon, 8 Jan 2024 16:32:28 +0800 Subject: [PATCH 1/2] test ci --- pkg/cluster/executor/ssh.go | 12 +++++++++--- pkg/cluster/task/builder.go | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/executor/ssh.go b/pkg/cluster/executor/ssh.go index 805013bcf7..e9a0faa13f 100644 --- a/pkg/cluster/executor/ssh.go +++ b/pkg/cluster/executor/ssh.go @@ -144,7 +144,7 @@ func (e *EasySSHExecutor) Execute(ctx context.Context, cmd string, sudo bool, ti // set a basic PATH in case it's empty on login cmd = fmt.Sprintf("PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin %s", cmd) - + fmt.Println("cmd1", cmd) if e.Locale != "" { cmd = fmt.Sprintf("export LANG=%s; %s", e.Locale, cmd) } @@ -154,9 +154,14 @@ func (e *EasySSHExecutor) Execute(ctx context.Context, cmd string, sudo bool, ti if len(timeout) == 0 { timeout = append(timeout, executeDefaultTimeout) } - + fmt.Println("cmd2", cmd) + fmt.Println("run command on remote host", e.Config.Server) stdout, stderr, done, err := e.Config.Run(cmd, timeout...) - + fmt.Println("stderr", stderr) + if stderr != "" { + fmt.Println("stderr cmd is", stderr, cmd) + } + fmt.Println("err", err) logfn := zap.L().Info if err != nil { logfn = zap.L().Error @@ -182,6 +187,7 @@ func (e *EasySSHExecutor) Execute(ctx context.Context, cmd string, sudo bool, ti e.Config.Server, color.YellowString(output))) } + fmt.Println("return err, cmd: ", cmd) return []byte(stdout), []byte(stderr), baseErr } diff --git a/pkg/cluster/task/builder.go b/pkg/cluster/task/builder.go index 96e74cbb09..23a26a9ce5 100644 --- a/pkg/cluster/task/builder.go +++ b/pkg/cluster/task/builder.go @@ -102,6 +102,7 @@ func (b *Builder) UserSSH( if sshType == "" { sshType = defaultSSHType } + fmt.Println("sshtype", sshType) b.tasks = append(b.tasks, &UserSSH{ host: host, port: port, From 8c8486822a3a304942c63f1bee703ab9feea1fd5 Mon Sep 17 00:00:00 2001 From: Yujie-Xie <1398010062@qq.com> Date: Mon, 8 Jan 2024 22:17:51 +0800 Subject: [PATCH 2/2] print deploy --- pkg/cluster/manager/deploy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/manager/deploy.go b/pkg/cluster/manager/deploy.go index c9b413edd3..fc01afe145 100644 --- a/pkg/cluster/manager/deploy.go +++ b/pkg/cluster/manager/deploy.go @@ -213,7 +213,10 @@ func (m *Manager) Deploy( if strings.HasPrefix(globalOptions.DataDir, "/") { dirs = append(dirs, globalOptions.DataDir) } - + fmt.Println("opt user", opt.User) + fmt.Println("globalOptions.User", globalOptions.User) + fmt.Println("dddd") + fmt.Println("ddd") t := task.NewBuilder(m.logger). RootSSH( host,