summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2021-09-28 17:01:57 -0400
committerAshley Cui <acui@redhat.com>2021-09-28 17:01:57 -0400
commit97f755f87b786884b293098646e5f242e119348c (patch)
tree9713d360096b373a89285cd0332d1f317619ae56 /cmd
parent14acec94b7f86ae329018e1e56fd111ff58bf057 (diff)
downloadpodman-97f755f87b786884b293098646e5f242e119348c.tar.gz
podman-97f755f87b786884b293098646e5f242e119348c.tar.bz2
podman-97f755f87b786884b293098646e5f242e119348c.zip
Remind user to check connection or use podman machine
Remind user to check their remote linux connection or use podman machine. Move the warning from bindings to cmd/podman. Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 58cab0268..eb30f1ef6 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -92,6 +92,11 @@ func Execute() {
if registry.GetExitCode() == 0 {
registry.SetExitCode(define.ExecErrorCodeGeneric)
}
+ if registry.IsRemote() {
+ if strings.Contains(err.Error(), "unable to connect to Podman") {
+ fmt.Fprintln(os.Stderr, "Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM")
+ }
+ }
fmt.Fprintln(os.Stderr, formatError(err))
}
os.Exit(registry.GetExitCode())