aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-12 13:06:02 -0400
committerGitHub <noreply@github.com>2020-08-12 13:06:02 -0400
commitbb3eceae56821903f6c51bebf77e5ef425868918 (patch)
tree25d836502f83a079461c17fdc14a5c90621a7fbf /cmd
parent73fa527ae1f83b3db025e361d73bb7966ef69626 (diff)
parent6ff42395d08217d86055456a9130fef8f78d34e2 (diff)
downloadpodman-bb3eceae56821903f6c51bebf77e5ef425868918.tar.gz
podman-bb3eceae56821903f6c51bebf77e5ef425868918.tar.bz2
podman-bb3eceae56821903f6c51bebf77e5ef425868918.zip
Merge pull request #7295 from baude/msiremotefixes
podman-remote fixes for msi and client
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go1
-rw-r--r--cmd/podman/system/connection/add.go13
2 files changed, 12 insertions, 2 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 2aa7267c2..dd9c75ece 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -290,6 +290,7 @@ func resolveDestination() (string, string) {
cfg, err := config.ReadCustomConfig()
if err != nil {
+ logrus.Warning(errors.Wrap(err, "unable to read local containers.conf"))
return registry.DefaultAPIAddress(), ""
}
diff --git a/cmd/podman/system/connection/add.go b/cmd/podman/system/connection/add.go
index 89cea10ca..af13b970c 100644
--- a/cmd/podman/system/connection/add.go
+++ b/cmd/podman/system/connection/add.go
@@ -124,6 +124,7 @@ func add(cmd *cobra.Command, args []string) error {
cfg.Engine.ServiceDestinations = map[string]config.Destination{
args[0]: dst,
}
+ cfg.Engine.ActiveService = args[0]
} else {
cfg.Engine.ServiceDestinations[args[0]] = dst
}
@@ -181,12 +182,20 @@ func getUDS(cmd *cobra.Command, uri *url.URL) (string, error) {
authMethods = append(authMethods, ssh.PublicKeysCallback(a.Signers))
}
- config := &ssh.ClientConfig{
+ if len(authMethods) == 0 {
+ pass, err := terminal.ReadPassword(fmt.Sprintf("%s's login password:", uri.User.Username()))
+ if err != nil {
+ return "", err
+ }
+ authMethods = append(authMethods, ssh.Password(string(pass)))
+ }
+
+ cfg := &ssh.ClientConfig{
User: uri.User.Username(),
Auth: authMethods,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
- dial, err := ssh.Dial("tcp", uri.Host, config)
+ dial, err := ssh.Dial("tcp", uri.Host, cfg)
if err != nil {
return "", errors.Wrapf(err, "failed to connect to %q", uri.Host)
}