Skip to content

Commit

Permalink
Optimize remote execution command return error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Dec 12, 2023
1 parent 80c948a commit 86f0f8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/ssh/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ func NewRemoteFromSSH(clusterName string, sshInterface Interface) *Remote {

func (s *Remote) executeRemoteUtilSubcommand(ip, cmd string) error {
cmd = fmt.Sprintf("%s %s", s.pathResolver.RootFSSealctlPath(), cmd)
return s.execer.CmdAsync(ip, cmd)
if err := s.execer.CmdAsync(ip, cmd); err != nil {
return fmt.Errorf("failed to execute remote command `%s`: %v", cmd, err)
}
return nil
}

func (s *Remote) outputRemoteUtilSubcommand(ip, cmd string) (string, error) {
Expand Down

0 comments on commit 86f0f8b

Please sign in to comment.