-
Notifications
You must be signed in to change notification settings - Fork 379
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
copy/multiple: priority of instanceCopyCopy
must be higher than instanceCopyClone
#2059
Conversation
When copying multiple images i.e `instanceCopyClone` and no image exists in registry in such case if clones are prepared and copied first then original copies will reuse blobs from the clone which is unexpected since argument `requireCompressionFormatMatch` is by default false for `instanceCopyCopy` case. Problem described in following PR is easily reproduceable when working with tools such as buildah, because without this PR buildah will push `clones` first instead of originals and later on `originals` will reuse blobs from `clones`. Signed-off-by: Aditya R <[email protected]>
@mtrmac A small bug which I found while working with buildah, I have explained issue in PR description. |
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.
One thing I’ve been idly wondering is whether we shouldn’t have a gzip annotation as well. That would allow us to determine whether an image is Zstd-only / gzip-only, or mixed. (Alternatively, we can just load the instance manifest and run the MIME type heuristic… and it might be possible to structure the code so that this has no extra cost.)
If we could differentiate single-algorithm images from mixed images, we could set requireCompressionFormatMatch
for instanceCopyCopy
if Ensure…Variants
is set. (OTOH I don’t know what we would do for mixed instances on input.)
I think such architecture changes are not welcome right at this moment, but I wanted to just mention this idea in case other use cases pop up, or to see if there is some other better approach I couldn’t think of.
Thanks! |
@mtrmac I agree with your comment above, I've found a more scalable solution for this case, WDYT about this flouthoc@ab9066c ? This will correctly ignore blobs for |
|
When copying multiple images i.e
instanceCopyClone
and no image exists in registry in such case if clones are prepared and copied first then original copies will reuse blobs from the clone which is unexpected since argumentrequireCompressionFormatMatch
is by default false forinstanceCopyCopy
case.Problem described in following PR is easily reproduceable when working with tools such as buildah, because without this PR buildah will push
clones
first instead of originals and later onoriginals
will reuse blobs fromclones
.Reproducer with empty registry