mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
add varlink bridge
allow the user to define a remote host and remote username for their remote podman sessions. this is then feed to the varlink "bridge" as the ssh credentials and endpoint. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
11
vendor/github.com/varlink/go/varlink/bridge.go
generated
vendored
11
vendor/github.com/varlink/go/varlink/bridge.go
generated
vendored
@@ -6,6 +6,7 @@ import (
|
||||
"bufio"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -30,12 +31,13 @@ func (p PipeCon) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewConnection returns a new connection to the given address.
|
||||
func NewBridge(bridge string) (*Connection, error) {
|
||||
// NewBridgeWithStderr returns a new connection with the given bridge.
|
||||
func NewBridgeWithStderr(bridge string, stderr io.Writer) (*Connection, error) {
|
||||
//var err error
|
||||
|
||||
c := Connection{}
|
||||
cmd := exec.Command("sh", "-c", bridge)
|
||||
cmd.Stderr = stderr
|
||||
r, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -56,3 +58,8 @@ func NewBridge(bridge string) (*Connection, error) {
|
||||
|
||||
return &c, nil
|
||||
}
|
||||
|
||||
// NewBridge returns a new connection with the given bridge.
|
||||
func NewBridge(bridge string) (*Connection, error) {
|
||||
return NewBridgeWithStderr(bridge, os.Stderr)
|
||||
}
|
||||
|
||||
11
vendor/github.com/varlink/go/varlink/bridge_windows.go
generated
vendored
11
vendor/github.com/varlink/go/varlink/bridge_windows.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -28,12 +29,13 @@ func (p PipeCon) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewConnection returns a new connection to the given address.
|
||||
func NewBridge(bridge string) (*Connection, error) {
|
||||
// NewBridgeWithStderr returns a new connection with the given bridge.
|
||||
func NewBridgeWithStderr(bridge string, stderr io.Writer) (*Connection, error) {
|
||||
//var err error
|
||||
|
||||
c := Connection{}
|
||||
cmd := exec.Command("cmd", "/C", bridge)
|
||||
cmd.Stderr = stderr
|
||||
r, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,3 +56,8 @@ func NewBridge(bridge string) (*Connection, error) {
|
||||
|
||||
return &c, nil
|
||||
}
|
||||
|
||||
// NewBridge returns a new connection with the given bridge.
|
||||
func NewBridge(bridge string) (*Connection, error) {
|
||||
return NewBridgeWithStderr(bridge, os.Stderr)
|
||||
}
|
||||
Reference in New Issue
Block a user