summaryrefslogtreecommitdiff
path: root/cmd/podman/inspect.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-04-17 11:01:45 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-17 13:22:06 -0500
commit44a8cf867665927111fe9ea03711c8fabfc7d4a2 (patch)
treecac0714b1d0e4ae4636c03191f4752235dd1a38d /cmd/podman/inspect.go
parentd68b028c9440cd3f952327b05f1bc8dee00ab98a (diff)
downloadpodman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.gz
podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.bz2
podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.zip
Fixes for system tests
Various fixes to protect against regressions in system tests Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/inspect.go')
-rw-r--r--cmd/podman/inspect.go13
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 {