Skip to content

Commit 1e8b69a

Browse files
committed
fix review
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent ad4c68c commit 1e8b69a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

internal/core/result.go

+5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ type SuccessResult struct {
1515
Details string
1616
Resource string
1717
Verb string
18+
Empty bool
1819
}
1920

2021
var standardSuccessMessages = map[string]string{
2122
"delete": "%s has been successfully deleted.",
2223
}
2324

2425
func (s *SuccessResult) MarshalHuman() (string, error) {
26+
if s.Empty {
27+
return "", nil
28+
}
29+
2530
message := s.getMessage()
2631
if !strings.HasSuffix(message, ".") {
2732
message += "."

internal/namespaces/instance/v1/custom_server_ssh.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func instanceServerSSHRun(ctx context.Context, argsI interface{}) (i interface{}
8686
"ssh", serverResp.Server.PublicIP.Address.String(),
8787
"-p", fmt.Sprintf("%d", args.Port),
8888
"-l", args.Username,
89-
args.Command,
89+
"-t", args.Command,
9090
)
9191

9292
sshCmd.Stdin = os.Stdin
@@ -95,8 +95,8 @@ func instanceServerSSHRun(ctx context.Context, argsI interface{}) (i interface{}
9595

9696
err = sshCmd.Run()
9797
if err != nil {
98-
return nil, fmt.Errorf("could not connect to server: %s", err)
98+
return nil, fmt.Errorf("got: %s", err)
9999
}
100100

101-
return nil, nil
101+
return &core.SuccessResult{Empty: true}, nil
102102
}

0 commit comments

Comments
 (0)