Skip to content

Commit 4a077cf

Browse files
authored
Use session.Run instead of session.Shell with session.Stdin (#2100)
Signed-off-by: egibs <[email protected]>
1 parent 955df03 commit 4a077cf

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pkg/container/qemu_runner.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,21 +1241,13 @@ func sendSSHCommand(ctx context.Context, client *ssh.Client,
12411241

12421242
cmd := shellquote.Join(command...)
12431243

1244-
session.Stdin = strings.NewReader(cmd)
1245-
12461244
clog.FromContext(ctx).Debugf("running (%d) %v", len(command), cmd)
1247-
err = session.Shell()
1245+
err = session.Run(cmd)
12481246
if err != nil {
12491247
clog.FromContext(ctx).Errorf("Failed to run command %q: %v", cmd, err)
12501248
return err
12511249
}
12521250

1253-
// Wait for the session to finish
1254-
if err := session.Wait(); err != nil {
1255-
clog.FromContext(ctx).Errorf("Failed wait for session running: %q: %v", cmd, err)
1256-
return err
1257-
}
1258-
12591251
return nil
12601252
}
12611253

0 commit comments

Comments
 (0)