diff options
author | baude <bbaude@redhat.com> | 2018-03-26 18:28:20 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-27 00:17:55 +0000 |
commit | 304bf53c28301a8dfd126f2304e02df5472e56b1 (patch) | |
tree | 37a3232f99f7c67f35f38cd0e6d85840040746b3 /cmd/podman | |
parent | a3156da21ccd830639ff5699c13da82f3062439b (diff) | |
download | podman-304bf53c28301a8dfd126f2304e02df5472e56b1.tar.gz podman-304bf53c28301a8dfd126f2304e02df5472e56b1.tar.bz2 podman-304bf53c28301a8dfd126f2304e02df5472e56b1.zip |
cmd/podman/run.go: Error nicely when no image found
When no image is found, display a useful error message. Also, in imageToRef
protect against a nil image being passed.
Resolves: #553
Signed-off-by: baude <bbaude@redhat.com>
Closes: #555
Approved by: mheon
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/run.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 523b973fb..21320f57c 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -56,6 +56,9 @@ func runCmd(c *cli.Context) error { rtc := runtime.GetConfig() newImage, err := runtime.ImageRuntime().New(c.Args()[0], rtc.SignaturePolicyPath, "", os.Stderr, nil, image.SigningOptions{}) + if err != nil { + return errors.Wrapf(err, "unable to find image") + } data, err := newImage.Inspect() if err != nil { |