aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-04 13:36:10 +0200
committerGitHub <noreply@github.com>2020-06-04 13:36:10 +0200
commita3f2a8d73c52a305ffeeab4ae4db0e81e8f19045 (patch)
treee7aeadcdd2215c2104226c59c8e60d1034ace871 /cmd/podman
parentd6e70c6df9ab9bf768efa69ba29601b64721ffd1 (diff)
parentd505989b0e34e3823dc65bc12fcc34e1f92bb5ce (diff)
downloadpodman-a3f2a8d73c52a305ffeeab4ae4db0e81e8f19045.tar.gz
podman-a3f2a8d73c52a305ffeeab4ae4db0e81e8f19045.tar.bz2
podman-a3f2a8d73c52a305ffeeab4ae4db0e81e8f19045.zip
Merge pull request #6482 from mheon/split_inspect
Ensure that image/container inspect are specialized
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/inspect.go8
-rw-r--r--cmd/podman/images/inspect.go5
2 files changed, 10 insertions, 3 deletions
diff --git a/cmd/podman/containers/inspect.go b/cmd/podman/containers/inspect.go
index 4549a4ef6..8556ebe83 100644
--- a/cmd/podman/containers/inspect.go
+++ b/cmd/podman/containers/inspect.go
@@ -26,9 +26,15 @@ func init() {
Command: inspectCmd,
Parent: containerCmd,
})
- inspectOpts = inspect.AddInspectFlagSet(inspectCmd)
+ inspectOpts = new(entities.InspectOptions)
+ flags := inspectCmd.Flags()
+ flags.BoolVarP(&inspectOpts.Size, "size", "s", false, "Display total file size")
+ flags.StringVarP(&inspectOpts.Format, "format", "f", "json", "Format the output to a Go template or json")
+ flags.BoolVarP(&inspectOpts.Latest, "latest", "l", false, "Act on the latest container Podman is aware of")
}
func inspectExec(cmd *cobra.Command, args []string) error {
+ // Force container type
+ inspectOpts.Type = inspect.ContainerType
return inspect.Inspect(args, *inspectOpts)
}
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)
}