File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
24
24
"net/url"
25
25
"strings"
26
26
"sync/atomic"
27
+ "syscall"
27
28
"time"
28
29
29
30
"github.com/google/go-containerregistry/internal/redact"
@@ -436,6 +437,16 @@ func (w *writer) uploadOne(l v1.Layer) error {
436
437
437
438
ctx := w .context
438
439
440
+ shouldRetry := func (err error ) bool {
441
+ // Various failure modes here, as we're often reading from and writing to
442
+ // the network.
443
+ if retry .IsTemporary (err ) || errors .Is (err , io .ErrUnexpectedEOF ) || errors .Is (err , syscall .EPIPE ) {
444
+ logs .Warn .Printf ("retrying %v" , err )
445
+ return true
446
+ }
447
+ return false
448
+ }
449
+
439
450
tryUpload := func () error {
440
451
location , mounted , err := w .initiateUpload (from , mount )
441
452
if err != nil {
@@ -495,7 +506,7 @@ func (w *writer) uploadOne(l v1.Layer) error {
495
506
Steps : 3 ,
496
507
}
497
508
498
- return retry .Retry (tryUpload , retry . IsTemporary , backoff )
509
+ return retry .Retry (tryUpload , shouldRetry , backoff )
499
510
}
500
511
501
512
type withLayer interface {
You can’t perform that action at this time.
0 commit comments