Merge pull request #7220 from jonnystoten/push-access-denied

Add extra context to error when push unauthorized
This commit is contained in:
Derek McGowan 2022-07-27 13:29:29 -07:00 committed by GitHub
commit c0ca151b33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,6 +190,9 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str
if resp == nil {
resp, err = req.doWithRetries(ctx, nil)
if err != nil {
if errors.Is(err, ErrInvalidAuthorization) {
return nil, fmt.Errorf("push access denied, repository does not exist or may require authorization: %w", err)
}
return nil, err
}
}