feat(transport): add resumable transport for remote resources#2152
feat(transport): add resumable transport for remote resources#2152derekhjray wants to merge 4 commits intogoogle:mainfrom
Conversation
| 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.
Please avoid labels and express this as a loop.
There was a problem hiding this comment.
My bad, I'm not familiar with Github's systems. I'll raise this in a review.
There was a problem hiding this comment.
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