summaryrefslogtreecommitdiff
path: root/cmd/podman/images/inspect.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-06-03 14:25:45 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-06-03 14:25:45 -0400
commitd505989b0e34e3823dc65bc12fcc34e1f92bb5ce (patch)
tree8c38b23a456e6f9fac5d3b2bdc062b8e68f28a2c /cmd/podman/images/inspect.go
parentcbfb4980ce7d9e6ed1ea769d0f42c52e1ad0bffa (diff)
downloadpodman-d505989b0e34e3823dc65bc12fcc34e1f92bb5ce.tar.gz
podman-d505989b0e34e3823dc65bc12fcc34e1f92bb5ce.tar.bz2
podman-d505989b0e34e3823dc65bc12fcc34e1f92bb5ce.zip
Ensure that image/container inspect are specialized
We are currently able to inspect images with `podman container inspect` and containers with `podman image inspect` and neither of those seem correct. This ensures that the appropriate flags, and only the appropriate flags, are available for each specialized exec, and they can only inspect the specific type they were intended to. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/images/inspect.go')
-rw-r--r--cmd/podman/images/inspect.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/images/inspect.go b/cmd/podman/images/inspect.go
index 8c727eb07..f6a10ba44 100644
--- a/cmd/podman/images/inspect.go
+++ b/cmd/podman/images/inspect.go
@@ -27,11 +27,12 @@ func init() {
Command: inspectCmd,
Parent: imageCmd,
})
- inspectOpts = inspect.AddInspectFlagSet(inspectCmd)
+ inspectOpts = new(entities.InspectOptions)
flags := inspectCmd.Flags()
- _ = flags.MarkHidden("latest") // Shared with container-inspect but not wanted here.
+ flags.StringVarP(&inspectOpts.Format, "format", "f", "json", "Format the output to a Go template or json")
}
func inspectExec(cmd *cobra.Command, args []string) error {
+ inspectOpts.Type = inspect.ImageType
return inspect.Inspect(args, *inspectOpts)
}