diff options
author | Matthew Heon <mheon@redhat.com> | 2019-02-12 13:11:07 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2019-02-12 13:11:07 -0500 |
commit | 28ee842b769b5ac4ff9a99a6c21fc66a4d011b9b (patch) | |
tree | 0322715393639eae77096f96cf540a6da8b92c5a /cmd | |
parent | 19a03976f73d21a821a07ae5f24250a4ceaee33a (diff) | |
download | podman-28ee842b769b5ac4ff9a99a6c21fc66a4d011b9b.tar.gz podman-28ee842b769b5ac4ff9a99a6c21fc66a4d011b9b.tar.bz2 podman-28ee842b769b5ac4ff9a99a6c21fc66a4d011b9b.zip |
Address review comments on #2319
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/attach.go | 2 | ||||
-rw-r--r-- | cmd/podman/cleanup.go | 4 | ||||
-rw-r--r-- | cmd/podman/cliconfig/config.go | 2 | ||||
-rw-r--r-- | cmd/podman/run.go | 2 | ||||
-rw-r--r-- | cmd/podman/start.go | 2 | ||||
-rw-r--r-- | cmd/podman/utils.go | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/cmd/podman/attach.go b/cmd/podman/attach.go index 8e760582d..ed175bdf4 100644 --- a/cmd/podman/attach.go +++ b/cmd/podman/attach.go @@ -74,7 +74,7 @@ func attachCmd(c *cliconfig.AttachValues) error { inputStream = nil } - if err := startAttachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.DetachKeys, c.SigProxy, false); err != nil && err != libpod.ErrDetach { + if err := startAttachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.DetachKeys, c.SigProxy, false); err != nil && errors.Cause(err) != libpod.ErrDetach { return errors.Wrapf(err, "error attaching to container %s", ctr.ID()) } diff --git a/cmd/podman/cleanup.go b/cmd/podman/cleanup.go index 064551189..537679d75 100644 --- a/cmd/podman/cleanup.go +++ b/cmd/podman/cleanup.go @@ -37,7 +37,7 @@ func init() { flags.BoolVarP(&cleanupCommand.All, "all", "a", false, "Cleans up all containers") flags.BoolVarP(&cleanupCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of") - flags.BoolVar(&cleanupCommand.Rm, "rm", false, "After cleanup, remove the container entirely") + flags.BoolVar(&cleanupCommand.Remove, "rm", false, "After cleanup, remove the container entirely") } func cleanupCmd(c *cliconfig.CleanupValues) error { @@ -57,7 +57,7 @@ func cleanupCmd(c *cliconfig.CleanupValues) error { for _, ctr := range cleanupContainers { hadError := false - if c.Rm { + if c.Remove { if err := runtime.RemoveContainer(ctx, ctr, false); err != nil { if lastError != nil { fmt.Fprintln(os.Stderr, lastError) diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go index e895b4a49..85ded6da0 100644 --- a/cmd/podman/cliconfig/config.go +++ b/cmd/podman/cliconfig/config.go @@ -531,7 +531,7 @@ type CleanupValues struct { PodmanCommand All bool Latest bool - Rm bool + Remove bool } type SystemPruneValues struct { diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 86dc02dea..16ec7c3c0 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -121,7 +121,7 @@ func runCmd(c *cliconfig.RunValues) error { // We've manually detached from the container // Do not perform cleanup, or wait for container exit code // Just exit immediately - if err == libpod.ErrDetach { + if errors.Cause(err) == libpod.ErrDetach { exitCode = 0 return nil } diff --git a/cmd/podman/start.go b/cmd/podman/start.go index 1de258aa4..d1434508d 100644 --- a/cmd/podman/start.go +++ b/cmd/podman/start.go @@ -108,7 +108,7 @@ func startCmd(c *cliconfig.StartValues) error { // attach to the container and also start it not already running err = startAttachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.DetachKeys, sigProxy, !ctrRunning) - if err == libpod.ErrDetach { + if errors.Cause(err) == libpod.ErrDetach { // User manually detached // Exit cleanly immediately exitCode = 0 diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index c62015344..744d010d5 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -91,7 +91,7 @@ func startAttachCtr(ctr *libpod.Container, stdout, stderr, stdin *os.File, detac err = <-attachChan if err != nil { - return err + return errors.Wrapf(err, "error attaching to container %s", ctr.ID()) } return nil |