mirror of
https://github.com/containers/podman.git
synced 2025-06-26 12:56:45 +08:00
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
This commit is contained in:
@ -465,6 +465,9 @@ func (i *Image) ToImageRef() (types.Image, error) {
|
||||
|
||||
// toImageRef returns an Image Reference type from an image
|
||||
func (i *Image) toImageRef() (types.Image, error) {
|
||||
if i == nil {
|
||||
return nil, errors.Errorf("cannot convert nil image to image reference")
|
||||
}
|
||||
if i.imgRef == nil {
|
||||
ref, err := is.Transport.ParseStoreReference(i.imageruntime.store, "@"+i.ID())
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user