Add extra context to error when push unauthorized
For consistency with pulls, see #2052. Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
This commit is contained in:
parent
6acde90772
commit
2fa84b1b8d
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user