diff options
author | baude <bbaude@redhat.com> | 2018-04-18 13:12:38 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-18 18:22:24 +0000 |
commit | cc7d1de1c11e1846552c0f81811a1fbab3711151 (patch) | |
tree | 0a17cd39ba136e5d5279caa99c304633c57087de /cmd | |
parent | 06f0d0bf6e3fd595d3726680a0ea1bc828b0cab9 (diff) | |
download | podman-cc7d1de1c11e1846552c0f81811a1fbab3711151.tar.gz podman-cc7d1de1c11e1846552c0f81811a1fbab3711151.tar.bz2 podman-cc7d1de1c11e1846552c0f81811a1fbab3711151.zip |
It is OK to start an already running container (with no attach)
Signed-off-by: baude <bbaude@redhat.com>
Closes: #637
Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/start.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmd/podman/start.go b/cmd/podman/start.go index 8f6fc5800..06b8f815f 100644 --- a/cmd/podman/start.go +++ b/cmd/podman/start.go @@ -90,16 +90,16 @@ func startCmd(c *cli.Context) error { continue } + ctrState, err := ctr.State() + if err != nil { + return errors.Wrapf(err, "unable to get container state") + } + if attach { inputStream := os.Stdin if !c.Bool("interactive") { inputStream = nil } - - ctrState, err := ctr.State() - if err != nil { - return errors.Wrapf(err, "unable to get container state") - } if ctrState == libpod.ContainerStateRunning { return attachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.String("detach-keys"), c.BoolT("sig-proxy")) } @@ -116,7 +116,10 @@ func startCmd(c *cli.Context) error { return ctr.Cleanup() } - + if ctrState == libpod.ContainerStateRunning { + fmt.Println(ctr.ID()) + continue + } // Handle non-attach start if err := ctr.Start(); err != nil { if lastError != nil { |