summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/kpod/create.go4
-rw-r--r--cmd/kpod/start.go5
2 files changed, 5 insertions, 4 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index 9a4539c14..9e810af6e 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -211,10 +211,6 @@ func createCmd(c *cli.Context) error {
}
logrus.Debug("new container created ", ctr.ID())
- if err := ctr.Init(); err != nil {
- return err
- }
- logrus.Debug("container storage created for %q", ctr.ID())
if c.String("cidfile") != "" {
libpod.WriteFile(ctr.ID(), c.String("cidfile"))
diff --git a/cmd/kpod/start.go b/cmd/kpod/start.go
index 7f9918fa2..fcc4c9736 100644
--- a/cmd/kpod/start.go
+++ b/cmd/kpod/start.go
@@ -5,6 +5,7 @@ import (
"sync"
"github.com/pkg/errors"
+ "github.com/projectatomic/libpod/libpod"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"os"
@@ -82,6 +83,10 @@ func startCmd(c *cli.Context) error {
continue
}
+ if err := ctr.Init(); err != nil && errors.Cause(err) != libpod.ErrCtrExists {
+ return err
+ }
+
// We can only be interactive if both the config and the command-line say so
if c.Bool("interactive") && !ctr.Config().Stdin {
return errors.Errorf("the container was not created with the interactive option")