summaryrefslogtreecommitdiff
path: root/cmd/podman/diff.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-04-20 09:27:54 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-20 09:27:54 -0700
commit3eac39aaa062c32597ed355d820f2dafc038faf0 (patch)
treebf2d7589cdb4f94043a0cec94aadbd4c47bb3dd6 /cmd/podman/diff.go
parente5e625b2a6481dd49d1d6303df1157c8a51dd7c2 (diff)
downloadpodman-3eac39aaa062c32597ed355d820f2dafc038faf0.tar.gz
podman-3eac39aaa062c32597ed355d820f2dafc038faf0.tar.bz2
podman-3eac39aaa062c32597ed355d820f2dafc038faf0.zip
V2 Fix --latest for podman diff commands
* --latest now forces container diff * diff options now passed into domain layer * updated help/usage messages Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/diff.go')
-rw-r--r--cmd/podman/diff.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/podman/diff.go b/cmd/podman/diff.go
index 8db76e8af..ec94c0918 100644
--- a/cmd/podman/diff.go
+++ b/cmd/podman/diff.go
@@ -46,10 +46,9 @@ func init() {
}
func diff(cmd *cobra.Command, args []string) error {
- if found, err := registry.ImageEngine().Exists(registry.GetContext(), args[0]); err != nil {
- return err
- } else if found.Value {
- return images.Diff(cmd, args, diffOpts)
+ // Latest implies looking for a container
+ if diffOpts.Latest {
+ return containers.Diff(cmd, args, diffOpts)
}
if found, err := registry.ContainerEngine().ContainerExists(registry.GetContext(), args[0]); err != nil {
@@ -57,5 +56,12 @@ func diff(cmd *cobra.Command, args []string) error {
} else if found.Value {
return containers.Diff(cmd, args, diffOpts)
}
+
+ if found, err := registry.ImageEngine().Exists(registry.GetContext(), args[0]); err != nil {
+ return err
+ } else if found.Value {
+ return images.Diff(cmd, args, diffOpts)
+ }
+
return fmt.Errorf("%s not found on system", args[0])
}