diff options
Diffstat (limited to 'cmd/kpod/create.go')
-rw-r--r-- | cmd/kpod/create.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go index 55f02e8e6..bbfeaebae 100644 --- a/cmd/kpod/create.go +++ b/cmd/kpod/create.go @@ -135,6 +135,7 @@ var createCommand = cli.Command{ func createCmd(c *cli.Context) error { // TODO should allow user to create based off a directory on the host not just image // Need CLI support for this + var imageName string if err := validateFlags(c, createFlags); err != nil { return err } @@ -151,7 +152,8 @@ func createCmd(c *cli.Context) error { // Deal with the image after all the args have been checked createImage := runtime.NewImage(createConfig.image) - if !createImage.HasImageLocal() { + createImage.LocalName, _ = createImage.GetLocalImageName() + if createImage.LocalName == "" { // The image wasnt found by the user input'd name or its fqname // Pull the image fmt.Printf("Trying to pull %s...", createImage.PullName) @@ -163,7 +165,11 @@ func createCmd(c *cli.Context) error { return err } defer runtime.Shutdown(false) - imageName, err := createImage.GetFQName() + if createImage.LocalName != "" { + imageName = createImage.LocalName + } else { + imageName, err = createImage.GetFQName() + } if err != nil { return err } |