-
Notifications
You must be signed in to change notification settings - Fork 384
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: add support for ForceCompressionFormat
#2068
copy: add support for ForceCompressionFormat
#2068
Conversation
@mtrmac @vrothberg PTAL |
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.
Thanks for working on this!
I think the two non-copyMultipleImages
paths should also implement this (or, at the very least, fail with an error). It seems to me that the three locations would benefit from a small shared helper function.
copy/multiple.go
Outdated
@@ -230,6 +230,16 @@ func (c *copier) copyMultipleImages(ctx context.Context) (copiedManifest []byte, | |||
logrus.Debugf("Copying instance %s (%d/%d)", instance.sourceDigest, i+1, len(instanceCopyList)) | |||
c.Printf("Copying image %s (%d/%d)\n", instance.sourceDigest, i+1, len(instanceCopyList)) | |||
unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceCopyList[i].sourceDigest) | |||
singleImageOpts := copySingleImageOptions{requireCompressionFormatMatch: false} |
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.
This value is not actually used AFAICS
I would also prefer it to be set in prepare…
; that way we can unit-test this. (I’m not saying that a unit test is required.)
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.
done, added test.
90d4dd5
to
b0768e3
Compare
Addressed all comments @vrothberg @mtrmac PTAL |
587ca74
to
76692b3
Compare
d357f4e
to
a7556dd
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.
ACK to the logic, now just some cleanup, please.
a7556dd
to
12c3048
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.
Thanks! LGTM.
@@ -163,6 +167,14 @@ type copier struct { | |||
signersToClose []*signer.Signer // Signers that should be closed when this copier is destroyed. | |||
} | |||
|
|||
// Internal function to validate `requireCompressionFormatMatch` for copySingleImageOptions | |||
func shouldRequireCompressionFormatMatch(options *Options) (bool, error) { |
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.
(Hiding this somewhere at the bottom, not near the top of the file, might help newcomers to the codebase who want to understand what this file is about.)
ForceCompressionFormat allows end users to force selected compression format (set in DestinationCtx.CompressionFormat) which ensures that while copying blobs of other compression algorithms are not reused. Following flag is a frontend wrapper for: containers#2023 Will help in: * containers/buildah#4613 * containers/podman#18660 Signed-off-by: Aditya R <arajan@redhat.com>
12c3048
to
f406c36
Compare
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/copier. Signed-off-by: Aditya R <arajan@redhat.com>
Implement containers/image#2068 for libimage/manifest.Push Signed-off-by: Aditya R <arajan@redhat.com>
ForceCompressionFormat allows end users to force selected compression format (set in DestinationCtx.CompressionFormat) which ensures that while copying blobs of other compression algorithms are not reused.
Following flag is a frontend wrapper for: #2023
Will help in: