fix: error type-check condition (#786)

Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
Matej Vasek 2022-01-26 18:44:45 +01:00 committed by GitHub
parent 7fe39cae18
commit 6c282e77c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ func CheckAuth(ctx context.Context, registry string, credentials docker.Credenti
tr, err := transport.NewWithContext(ctx, reg, authenticator, trans, nil)
if err != nil {
var transportErr *transport.Error
if errors.As(err, &transportErr); transportErr.StatusCode == 401 {
if errors.As(err, &transportErr) && transportErr.StatusCode == 401 {
return ErrUnauthorized
}
return err