Signed-off-by: Darren Stahl <darst@microsoft.com>
| ... | ... |
@@ -6,6 +6,7 @@ import ( |
| 6 | 6 |
"syscall" |
| 7 | 7 |
|
| 8 | 8 |
"github.com/Sirupsen/logrus" |
| 9 |
+ "github.com/docker/distribution" |
|
| 9 | 10 |
"github.com/docker/distribution/registry/api/errcode" |
| 10 | 11 |
"github.com/docker/distribution/registry/api/v2" |
| 11 | 12 |
"github.com/docker/distribution/registry/client" |
| ... | ... |
@@ -139,6 +140,9 @@ func retryOnError(err error) error {
|
| 139 | 139 |
case *client.UnexpectedHTTPResponseError: |
| 140 | 140 |
return xfer.DoNotRetry{Err: err}
|
| 141 | 141 |
case error: |
| 142 |
+ if err == distribution.ErrBlobUnknown {
|
|
| 143 |
+ return xfer.DoNotRetry{Err: err}
|
|
| 144 |
+ } |
|
| 142 | 145 |
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
|
| 143 | 146 |
return xfer.DoNotRetry{Err: err}
|
| 144 | 147 |
} |
| ... | ... |
@@ -189,9 +189,6 @@ func (ld *v2LayerDescriptor) Download(ctx context.Context, progressOutput progre |
| 189 | 189 |
layerDownload, err := ld.open(ctx) |
| 190 | 190 |
if err != nil {
|
| 191 | 191 |
logrus.Errorf("Error initiating layer download: %v", err)
|
| 192 |
- if err == distribution.ErrBlobUnknown {
|
|
| 193 |
- return nil, 0, xfer.DoNotRetry{Err: err}
|
|
| 194 |
- } |
|
| 195 | 192 |
return nil, 0, retryOnError(err) |
| 196 | 193 |
} |
| 197 | 194 |
|