summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/kpod/create.go12
-rw-r--r--cmd/kpod/run.go12
2 files changed, 24 insertions, 0 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index 2684f8927..30837e7df 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -171,6 +171,18 @@ func createCmd(c *cli.Context) error {
return err
}
if createImage.LocalName != "" {
+ nameIsID, err := runtime.IsImageID(createImage.LocalName)
+ if err != nil {
+ return err
+ }
+ if nameIsID {
+ // If the input from the user is an ID, then we need to get the image
+ // name for cstorage
+ createImage.LocalName, err = createImage.GetNameByID()
+ if err != nil {
+ return err
+ }
+ }
imageName = createImage.LocalName
} else {
imageName, err = createImage.GetFQName()
diff --git a/cmd/kpod/run.go b/cmd/kpod/run.go
index 275654f65..b79ba5121 100644
--- a/cmd/kpod/run.go
+++ b/cmd/kpod/run.go
@@ -54,6 +54,18 @@ func runCmd(c *cli.Context) error {
logrus.Debug("spec is ", runtimeSpec)
if createImage.LocalName != "" {
+ nameIsID, err := runtime.IsImageID(createImage.LocalName)
+ if err != nil {
+ return err
+ }
+ if nameIsID {
+ // If the input from the user is an ID, then we need to get the image
+ // name for cstorage
+ createImage.LocalName, err = createImage.GetNameByID()
+ if err != nil {
+ return err
+ }
+ }
imageName = createImage.LocalName
} else {
imageName, err = createImage.GetFQName()