cli/connhelper: use stdlib errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2c24fb2bcd
commit
c77159623b
@ -3,13 +3,13 @@ package connhelper
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/connhelper/commandconn"
|
"github.com/docker/cli/cli/connhelper/commandconn"
|
||||||
"github.com/docker/cli/cli/connhelper/ssh"
|
"github.com/docker/cli/cli/connhelper/ssh"
|
||||||
"github.com/pkg/errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConnectionHelper allows to connect to a remote host with custom stream provider binary.
|
// ConnectionHelper allows to connect to a remote host with custom stream provider binary.
|
||||||
@ -43,7 +43,7 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
|
|||||||
if u.Scheme == "ssh" {
|
if u.Scheme == "ssh" {
|
||||||
sp, err := ssh.ParseURL(daemonURL)
|
sp, err := ssh.ParseURL(daemonURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "ssh host connection is not valid")
|
return nil, fmt.Errorf("ssh host connection is not valid: %w", err)
|
||||||
}
|
}
|
||||||
sshFlags = addSSHTimeout(sshFlags)
|
sshFlags = addSSHTimeout(sshFlags)
|
||||||
sshFlags = disablePseudoTerminalAllocation(sshFlags)
|
sshFlags = disablePseudoTerminalAllocation(sshFlags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user