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

Commit e9d5292

Browse files
committed
Unwrap URL errors on retry
When authorization errors are returned by the token process the error will be wrapped in url.Error. In order to check the underlying error for retry this error message should be unwrapped. Unwrapping this error allows failure to push due to an unauthorized response to keep from retrying, possibly resulting in later 429 responses. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
1 parent 7bddbdf commit e9d5292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

distribution/registry.go

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ func retryOnError(err error) error {
145145
case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied:
146146
return xfer.DoNotRetry{Err: err}
147147
}
148+
case *url.Error:
149+
return retryOnError(v.Err)
148150
case *client.UnexpectedHTTPResponseError:
149151
return xfer.DoNotRetry{Err: err}
150152
}

0 commit comments

Comments
 (0)