kpod create should not do an OCI Init

We need to differentiate between a kpod create and a kpod start
kpod create should create all of the data for libpod, but kpod start should
generate content for OCI Runtime (runc) in order to run.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #96
Approved by: mheon
This commit is contained in:
Daniel J Walsh
2017-12-02 06:00:53 -05:00
committed by Atomic Bot
parent 55c8b69d8f
commit 95cb7a11f1
3 changed files with 7 additions and 6 deletions

View File

@ -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"))

View File

@ -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")