Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 26334b7

Browse files
committed
Merge pull request #19551 from aaronlehmann/fix-retry-on-enospc
Don't retry downloads when disk is full
2 parents d2448a0 + 4f13ec5 commit 26334b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

distribution/registry.go

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net/http"
77
"net/url"
88
"strings"
9+
"syscall"
910
"time"
1011

1112
"github.com/docker/distribution"
@@ -149,6 +150,10 @@ func retryOnError(err error) error {
149150
return retryOnError(v.Err)
150151
case *client.UnexpectedHTTPResponseError:
151152
return xfer.DoNotRetry{Err: err}
153+
case error:
154+
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
155+
return xfer.DoNotRetry{Err: err}
156+
}
152157
}
153158
// let's be nice and fallback if the error is a completely
154159
// unexpected one.

0 commit comments

Comments
 (0)