Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect documentation examples for podman-image-diff #10649

Closed
infiniteregrets opened this issue Jun 10, 2021 · 2 comments · Fixed by #10836
Closed

Incorrect documentation examples for podman-image-diff #10649

infiniteregrets opened this issue Jun 10, 2021 · 2 comments · Fixed by #10836
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@infiniteregrets
Copy link

infiniteregrets commented Jun 10, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
In the documentation at http://docs.podman.io/en/latest/markdown/podman-image-diff.1.html
this example: podman diff --format json redis:old redis:alpine is used. But this does not work with the current version of podman.

:/$ podman image diff alpine:latest alpine:3
:/$ Error: accepts 1 arg(s), received 2 
:/$ podman diff alpine:latest alpine:3
:/$ Error: `podman diff` accepts at most one argument 

I think when a single image is mentioned the diff should be done between the image and its parent layer and when two are mentioned the diff should be between them.

The JSON output when --format=json flag is used is not indented and JSON is not accepted as a valid option, which in my opinion should be. This would just be a minor fix in the regular expression here:

var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*(\.)?\s*}})\s*$`)

Output of podman version:

podman version 3.1.2

Please provide correct documentation examples, and if there are any potential bug fixes then let me know! I would love to try working on them

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 10, 2021
@rhatdan
Copy link
Member

rhatdan commented Jun 11, 2021

Please open a PR to fix the documentation, and if you want to add the feature to compare two images, then go for it.

@infiniteregrets
Copy link
Author

I have already opened #10536 and it's in progress. In the meantime, i'll try working on this

Luap99 added a commit to Luap99/libpod that referenced this issue Jul 2, 2021
First, make podman diff accept optionally a second argument. This allows
the user to specify a second image/container to compare the first with.
If it is not set the parent layer will be used as before.

Second, podman container diff should only use containers and podman
image diff should only use images. Previously, podman container diff
would use the image when both an image and container with this name
exists.

To make this work two new parameters have been added to the api. If they
are not used the previous behaviour is used. The same applies to the
bindings.

Fixes containers#10649

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants