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

podman diff accept two images or containers #10836

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jul 1, 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 #10649

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 1, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2021
@infiniteregrets
Copy link

Thanks @Luap99, I kind of understood where I was going wrong.
Can you add this table to docs for image diff:

The output is prefixed with the following symbols:

| Symbol | Description |
|--------|-------------|
| A | A file or directory was added. |
| D | A file or directory was deleted. |
| C | A file or directory was changed. |

@Luap99
Copy link
Member Author

Luap99 commented Jul 1, 2021

@infiniteregrets I added this all three diff man pages.

@infiniteregrets
Copy link

Looks good!


const (
// only diff containers
DiffContainer DiffType = 1 << iota
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a bitfield, it seems like it would be better to manually specify - 0b1, 0b10, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 << iota is basically just saying to shift the bit one step for each entry. It should be less error prone than writing this manually especially when you add new entries, However I understand that this syntax is confusing if you are not familiar with it. I can remove it if you want.

@mheon
Copy link
Member

mheon commented Jul 1, 2021

One nit otherwise LGTM

@Luap99 Luap99 force-pushed the diff branch 2 times, most recently from cf44e5e to 8ea2ebb Compare July 2, 2021 14:04
@baude
Copy link
Member

baude commented Jul 2, 2021

/hold
/lgtm

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 2, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label 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]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2021
@Luap99
Copy link
Member Author

Luap99 commented Jul 2, 2021

I had to repush to fix a test.

@TomSweeneyRedHat
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2021
@rhatdan
Copy link
Member

rhatdan commented Jul 3, 2021

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2021
@openshift-merge-robot openshift-merge-robot merged commit 895b815 into containers:main Jul 3, 2021
@Luap99 Luap99 deleted the diff branch July 3, 2021 11:34
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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 this pull request may close these issues.

Incorrect documentation examples for podman-image-diff
7 participants