diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-17 14:43:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 14:43:21 -0400 |
commit | ba289dcd79e3a2b5ec5dc02bd8adb84c93bef577 (patch) | |
tree | 977792d0b732bb67f9270d34e30bfac3cb5aab73 /cmd/podman/inspect.go | |
parent | a5884c07dfb092eab88cf153238e714910388a06 (diff) | |
parent | 44a8cf867665927111fe9ea03711c8fabfc7d4a2 (diff) | |
download | podman-ba289dcd79e3a2b5ec5dc02bd8adb84c93bef577.tar.gz podman-ba289dcd79e3a2b5ec5dc02bd8adb84c93bef577.tar.bz2 podman-ba289dcd79e3a2b5ec5dc02bd8adb84c93bef577.zip |
Merge pull request #5868 from baude/v2t2
Fixes for system tests
Diffstat (limited to 'cmd/podman/inspect.go')
-rw-r--r-- | cmd/podman/inspect.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go index 0393303e8..e67bc326b 100644 --- a/cmd/podman/inspect.go +++ b/cmd/podman/inspect.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/containers/image/v5/docker/reference" "github.com/containers/libpod/cmd/podman/common" "github.com/containers/libpod/cmd/podman/containers" "github.com/containers/libpod/cmd/podman/images" @@ -37,12 +38,14 @@ func init() { } func inspect(cmd *cobra.Command, args []string) error { - if found, err := registry.ImageEngine().Exists(context.Background(), args[0]); err != nil { - return err - } else if found.Value { - return images.Inspect(cmd, args, inspectOpts) + // First check if the input is even valid for an image + if _, err := reference.Parse(args[0]); err == nil { + if found, err := registry.ImageEngine().Exists(context.Background(), args[0]); err != nil { + return err + } else if found.Value { + return images.Inspect(cmd, args, inspectOpts) + } } - if found, err := registry.ContainerEngine().ContainerExists(context.Background(), args[0]); err != nil { return err } else if found.Value { |