Revert "Return no basic auth creds error when needed"

This reverts commit 8777592397, which
turns out to break other test cases/the registry flow.

The correct place to handle missing credentials is instead
15bf23df09/remotes/docker/authorizer.go (L200).

Co-authored-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
This commit is contained in:
Bjorn Neergaard 2023-10-13 11:39:09 -06:00
parent c2aa895908
commit 40fde69be9
No known key found for this signature in database

View file

@ -11,7 +11,6 @@ import (
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/version"
"github.com/containerd/log"
"github.com/docker/distribution/registry/client/auth"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/useragent"
@ -76,15 +75,11 @@ func authorizerFromAuthConfig(authConfig registrytypes.AuthConfig) docker.Author
"host": host,
"cfgHost": cfgHost,
}).Warn("Host doesn't match")
return "", "", auth.ErrNoBasicAuthCredentials
return "", "", nil
}
if authConfig.IdentityToken != "" {
return "", authConfig.IdentityToken, nil
}
if authConfig.Username == "" && authConfig.Password == "" {
return "", "", auth.ErrNoBasicAuthCredentials
}
return authConfig.Username, authConfig.Password, nil
}))
}