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

WIP: Expect UncompressedDigest to be set for partial pulls, enforce DiffID match #2613

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Oct 30, 2024

mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 30, 2024
mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 30, 2024
mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 30, 2024
// FIXME: Always enforce this for all layers??!
d, err := s.untrustedLayerDiffID(index)
if err != nil {
return nil, err
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All of this completely breaks for non-OCI images: determining DiffID for manifest type %q is not yet supported

This needs to be implemented for v2s2, and we need a reasonable fallback for v2s1.

mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 18, 2024
mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 18, 2024
mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 18, 2024
@mtrmac mtrmac force-pushed the wip-authentic branch 3 times, most recently from e46c8d0 to eb0db7b Compare November 22, 2024 20:15
mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 25, 2024
> go mod edit -replace github.com/containers/image/v5=github.com/mtrmac/image/v5@wip-authentic

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac mtrmac force-pushed the wip-authentic branch 4 times, most recently from 95cdcf3 to 57b0637 Compare November 26, 2024 20:38
mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 26, 2024
> go mod edit -replace github.com/containers/image/v5=github.com/mtrmac/image/v5@wip-authentic

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac mtrmac force-pushed the wip-authentic branch 2 times, most recently from 517aa3f to 137b760 Compare November 27, 2024 22:07
... because we will start enforcing that the DiffID values match.

Signed-off-by: Miloslav Trmač <[email protected]>
... to simplify some of the repetitive logging code.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
untrustedLayerDiffID currently specializes the "not available yet"
case; also specialize the "image does not provide this at all"
case, which we will need to handle.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
We will use the trustedLayerIdentityData for other purposes in the caller as well.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Two different locations in the function need the data, and the
caller must have it available; so always passing it in simplifies
the implementation and removes an impossible error path.

This might hypothetically make layer reuse a bit worse, if we
happened to learn something for trustedLayerIdentityData from
processing other layers of the same image, but reusing the same
layer twice within an image should be are.

Signed-off-by: Miloslav Trmač <[email protected]>
commitLayer already contains detailed logic for computing
the final layer ID (chain ID), so having the detailed logic
for the single layer component in a separate function is not
any clearer.

Should not change behavior.

Instead, outline the whole thing and add unit tests.

Signed-off-by: Miloslav Trmač <[email protected]>
We will want c/storage to do that in order to avoid the traditional/partial "view"
ambiguity.

Signed-off-by: Miloslav Trmač <[email protected]>
FIXME: the "this is centrally enforced later" comment should be added
with that enforcement.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Note the FIXMEs

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/libpod that referenced this pull request Nov 28, 2024
> go mod edit -replace github.com/containers/image/v5=github.com/mtrmac/image/v5@wip-authentic

Signed-off-by: Miloslav Trmač <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant