summaryrefslogtreecommitdiff
path: root/cmd/podman/images
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/images
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/images')
-rw-r--r--cmd/podman/images/diff.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/podman/images/diff.go b/cmd/podman/images/diff.go
index dd98dc4d6..7cfacfc6c 100644
--- a/cmd/podman/images/diff.go
+++ b/cmd/podman/images/diff.go
@@ -11,8 +11,8 @@ import (
var (
// podman container _inspect_
diffCmd = &cobra.Command{
- Use: "diff [flags] CONTAINER",
- Args: registry.IdOrLatestArgs,
+ Use: "diff [flags] IMAGE",
+ Args: cobra.ExactArgs(1),
Short: "Inspect changes on image's file systems",
Long: `Displays changes on a image's filesystem. The image will be compared to its parent layer.`,
RunE: diff,
@@ -32,16 +32,16 @@ func init() {
diffOpts = &entities.DiffOptions{}
flags := diffCmd.Flags()
flags.BoolVar(&diffOpts.Archive, "archive", true, "Save the diff as a tar archive")
- _ = flags.MarkHidden("archive")
+ _ = flags.MarkDeprecated("archive", "Provided for backwards compatibility, has no impact on output.")
flags.StringVar(&diffOpts.Format, "format", "", "Change the output format")
}
func diff(cmd *cobra.Command, args []string) error {
- if len(args) == 0 && !diffOpts.Latest {
- return errors.New("image must be specified: podman image diff [options [...]] ID-NAME")
+ if diffOpts.Latest {
+ return errors.New("image diff does not support --latest")
}
- results, err := registry.ImageEngine().Diff(registry.GetContext(), args[0], entities.DiffOptions{})
+ results, err := registry.ImageEngine().Diff(registry.GetContext(), args[0], *diffOpts)
if err != nil {
return err
}