-
Notifications
You must be signed in to change notification settings - Fork 242
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
chunked: ignore the tar-split data if digest is empty #1936
chunked: ignore the tar-split data if digest is empty #1936
Conversation
if a digest was not specified in the TOC, ignore completely the tar-split data. Otherwise the clients fail to pull images created before commit b5413c2. Signed-off-by: Giuseppe Scrivano <[email protected]>
@mtrmac PTAL I wonder if it would be cleaner to also move the tar-split offsets into the TOC, instead of having half the information in the TOC and half in the annotations. |
answering to myself: this would be a bad idea as we will need an additional HTTP request to retrieve it |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, giuseppe 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 |
/lgtm |
Can we rush this into podman 5.1.1? |
/cherrypick release-1.54 |
@giuseppe: new pull request created: #1938 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
Actually … with the design of #1902, the fix on #1888 wants the layer contents to be fully determined by the TOC.
So:
- if
toc.TarSplitDigest == ""
, the tar-split must be ignored (what this PR does) - if
toc.TarSplitDigest != ""
, we must have, validate, and consume the tar-split; iftarSplitChunk.Offset <= 0
, the layer is inconsistent and using it (at least by TOC) must fail.
return nil, nil, nil, 0, fmt.Errorf("validating and decompressing tar-split: %w", err) | ||
tarSplitDigest := toc.TarSplitDigest.String() | ||
// ignore the tar-split data if the digest was not specified | ||
if tarSplitDigest != "" { |
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.
(Absolutely non-blocking: I’d just do if tarSplitChunk.Offset > 0 && toc.TarSplitDigest != ""
, directly comparing digest.Digest
to ""
is fairly frequent, and one less nesting level is nice.)
if a digest was not specified in the TOC, ignore completely the tar-split data.
Otherwise the clients fail to pull images created before commit b5413c2.