mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Stop retrying pull on UnkownBlob error
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
4fae94f663
commit
dee2968560
2 changed files with 4 additions and 3 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
"github.com/docker/distribution"
|
||||||
"github.com/docker/distribution/registry/api/errcode"
|
"github.com/docker/distribution/registry/api/errcode"
|
||||||
"github.com/docker/distribution/registry/api/v2"
|
"github.com/docker/distribution/registry/api/v2"
|
||||||
"github.com/docker/distribution/registry/client"
|
"github.com/docker/distribution/registry/client"
|
||||||
|
@ -139,6 +140,9 @@ func retryOnError(err error) error {
|
||||||
case *client.UnexpectedHTTPResponseError:
|
case *client.UnexpectedHTTPResponseError:
|
||||||
return xfer.DoNotRetry{Err: err}
|
return xfer.DoNotRetry{Err: err}
|
||||||
case error:
|
case error:
|
||||||
|
if err == distribution.ErrBlobUnknown {
|
||||||
|
return xfer.DoNotRetry{Err: err}
|
||||||
|
}
|
||||||
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
|
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
|
||||||
return xfer.DoNotRetry{Err: err}
|
return xfer.DoNotRetry{Err: err}
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,9 +189,6 @@ func (ld *v2LayerDescriptor) Download(ctx context.Context, progressOutput progre
|
||||||
layerDownload, err := ld.open(ctx)
|
layerDownload, err := ld.open(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorf("Error initiating layer download: %v", err)
|
logrus.Errorf("Error initiating layer download: %v", err)
|
||||||
if err == distribution.ErrBlobUnknown {
|
|
||||||
return nil, 0, xfer.DoNotRetry{Err: err}
|
|
||||||
}
|
|
||||||
return nil, 0, retryOnError(err)
|
return nil, 0, retryOnError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue