-
Notifications
You must be signed in to change notification settings - Fork 236
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
Use layers digests for comparing podman images #1514
Conversation
@praiskup Do you think this is the viable approach for comparing images? |
ec5786a
to
a00ed6e
Compare
a00ed6e
to
d89e87c
Compare
Proposal from slack is to also add checking of Config section. If we decide for this I can add e.g. checksum of sorted dict of Config. |
Probably? I'm not the best person to judge :-) have you tried to contact someone from the Podman team? |
Tested with
And it seems to work. |
Tested with |
Can you please rebase on top of the current Also note that there's https://github.com/rpm-software-management/mock/blob/main/behave/features/hermetic-build.feature, so the It would be nice to mention the podman discussion I started somewhere in the code (or commit message). |
d89e87c
to
c48df2e
Compare
4c54cee
to
9e0b82e
Compare
CI fail: |
|
0e7bc41
to
7179674
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- we need to resolve the json versioning issue
- new release notes entry
- I would make it failing on checksum mismatch again, as this method is reliable
- please squash, and refer the commit to Howto rule out a MITM attack after re-importing the image-as-tarball? containers/podman#24818
Otherwise thank you, LGTM, nice one :)
67ca07b
to
2c83b5a
Compare
2c83b5a
to
c95eac1
Compare
Seems to work, the CI failure was probably some cache problem / race condition (after re-run, it is green now) . What remains is to handle the JSON scheme reasonably. I think we could keep the old scheme as-is, and not rename the field. Just change the documentation for the field that it is not the built-in digest. |
Nit: See the comment 2, there's one pep8speaks issue. |
c95eac1
to
a461145
Compare
So, do you think that also the method should stage |
a461145
to
8f7301c
Compare
42fabed
to
1a075f3
Compare
No strong opinion, but it's not "just layers", we include ".Config" too. |
There's this error though:
|
1a075f3
to
8861160
Compare
Fixed, anyway - how you were able to trigger it? Older lockfile? |
Nor it is an image digest (as understood in container world). |
That was triggered by the testing-farm CI, the latest one is being run right now by Packit: |
🤷♂️ yeah I agree, we can call it |
8861160
to
7d5cd17
Compare
Previous method checked default digest provided by podman. This digest is "local" and changed every time image is saved/load or at any other point manifest is modified. This doesn't mean that it is a different image. Viable way for our purposes is to compare that all layers are identical and in the same order. Simple way to distill this into one value is to concatenate individual layers' digests in order of appearance in RootFS. Related to discussion at containers/podman#24818
7d5cd17
to
90a5ce6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Previous method checked default digest provided by podman. This digest is "local" and changed every time image is saved/load or at any other point manifest is modified. This doesn't mean that it is a different image.
Viable way for our purposes is to compare that all layers are identical and in the same order. Simple way to distill this into one value is to concatenate individual layers' digests in order of appearance in RootFS.