-
Notifications
You must be signed in to change notification settings - Fork 610
feat(transport): add resumable transport for remote resources #2152
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
base: main
Are you sure you want to change the base?
Conversation
pkg/v1/remote/transport/resumable.go
Outdated
| resume: | ||
| if n, err = rb.rc.Read(p); n > 0 { | ||
| rb.transferred += int64(n) | ||
| } | ||
|
|
||
| if err == nil { | ||
| return | ||
| } | ||
|
|
||
| if errors.Is(err, io.EOF) && rb.total >= 0 && rb.transferred == rb.total { | ||
| return | ||
| } | ||
|
|
||
| if err = rb.resume(err); err == nil { | ||
| if n == 0 { | ||
| // zero bytes read, try reading again with new response.Body | ||
| goto resume | ||
| } | ||
|
|
||
| // already read some bytes from previous response.Body, returns and waits for next Read operation | ||
| } |
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.
Please avoid labels and express this as a loop.
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.
My bad, I'm not familiar with Github's systems. I'll raise this in a review.
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.
(reopening)
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.
Please avoid labels and express this as a loop.
modified
|
Thank you for the contribution! I am going to get another person familiar with Docker on our team to look at this change. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2152 +/- ##
===========================================
- Coverage 71.67% 53.01% -18.67%
===========================================
Files 123 165 +42
Lines 9935 11101 +1166
===========================================
- Hits 7121 5885 -1236
- Misses 2115 4482 +2367
- Partials 699 734 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add resumable transport support for pulling images from registry, which is useful for huge image pulling operation, and avoid downloading all image/layer data again when error hanpens