mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
update c/common to latest main
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
9
vendor/github.com/containers/common/pkg/ssh/ssh.go
generated
vendored
9
vendor/github.com/containers/common/pkg/ssh/ssh.go
generated
vendored
@@ -2,6 +2,7 @@ package ssh
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
@@ -27,15 +28,19 @@ func Dial(options *ConnectionDialOptions, kind EngineMode) (*ssh.Client, error)
|
||||
}
|
||||
|
||||
func Exec(options *ConnectionExecOptions, kind EngineMode) (string, error) {
|
||||
return ExecWithInput(options, kind, nil)
|
||||
}
|
||||
|
||||
func ExecWithInput(options *ConnectionExecOptions, kind EngineMode, input io.Reader) (string, error) {
|
||||
var rep *ConnectionExecReport
|
||||
var err error
|
||||
if kind == NativeMode {
|
||||
rep, err = nativeConnectionExec(*options)
|
||||
rep, err = nativeConnectionExec(*options, input)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
} else {
|
||||
rep, err = golangConnectionExec(*options)
|
||||
rep, err = golangConnectionExec(*options, input)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user