-
Notifications
You must be signed in to change notification settings - Fork 374
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
Refactor data passing in c/image/copy #2048
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Generally I discourage unsing named return values, it's easy to miss that it wasn't set - I have no idea what the "in the middle of a multi-streamed copy" paragraph refers to. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that we don't have to carry it around in extra parameters. Migrating individual functions will follow. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that we can eliminate three parameters. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that the code looks the same here and in possible callees. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use options.Progress and ProgressInterval directly. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use c.options.OciDecryptConfig directly. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use c.options.OciEncryptConfig directly. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use c.options.DownloadForeignLayers directly. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use ic.c.options.OciEncryptLayers directly. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
So that we don't need to pass it around in a parameter. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use copier.unparsedToplevel now that it exists. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that we don't need to carry it around in parameters. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
It is no longer used. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that we don't have so many unnamed return values, and we can manage the return values as a batch. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
…sult on a match ... so that the caller doesn't have to assemble it. Using a pointer-or-nil eliminates a separate boolean. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... instead of three separate ones. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This LGTM I'll rebase my PR on top of this. I don't have merge access. |
@vrothberg Could you PTAL |
vrothberg
approved these changes
Jul 19, 2023
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.
Very nice refactor and with surgical precision :)
LGTM
flouthoc
added a commit
to flouthoc/image
that referenced
this pull request
Jul 21, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc
added a commit
to flouthoc/image
that referenced
this pull request
Jul 21, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc
added a commit
to flouthoc/image
that referenced
this pull request
Jul 21, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc
added a commit
to flouthoc/image
that referenced
this pull request
Jul 21, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc
added a commit
to flouthoc/image
that referenced
this pull request
Aug 4, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
mtrmac
pushed a commit
to mtrmac/image
that referenced
this pull request
Aug 4, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
mtrmac
pushed a commit
to mtrmac/image
that referenced
this pull request
Aug 5, 2023
After containers#2048 there is no room for copy/multiple to pass custom compressionFormat to copySingleImage while processing each instance, following PR introduces that functionality again and wraps options to simpler struct. Signed-off-by: Aditya R <arajan@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is motivated by the concurrent Zstd work, to make it more maintainable to pass data from and to
copySingleImage
.copier.options
,copier.policyContext
andcopier.unparsedToplevel
instead of passing them around in parameterscopier
andimageCopier
that are now reachable through.options
copySingleImageResult
fromcopySingleImage
@flouthoc I realize this is disruptive, and I want to do whatever necessary not to disrupt or slow down your work. Let me know what works for you — feel free to completely ignore this (and I’ll rebase this later as necessary), to reimplement parts yourself in some other way, or to tell me to split this up (maybe only the
copySingleImageResult
part?).Others: Please don’t merge this without an ACK from @flouthoc .