Merge pull request #19551 from aaronlehmann/fix-retry-on-enospc

Don't retry downloads when disk is full
This commit is contained in:
Tibor Vass 2016-01-21 15:37:50 -05:00
commit 26334b7a7d
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"net/http"
"net/url"
"strings"
"syscall"
"time"
"github.com/docker/distribution"
@ -149,6 +150,10 @@ func retryOnError(err error) error {
return retryOnError(v.Err)
case *client.UnexpectedHTTPResponseError:
return xfer.DoNotRetry{Err: err}
case error:
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
return xfer.DoNotRetry{Err: err}
}
}
// let's be nice and fallback if the error is a completely
// unexpected one.