registry: remove unused fallbackError
Nothing was emitting this error. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
8947730124
commit
5e9829b75d
|
@ -63,14 +63,6 @@ func (scs staticCredentialStore) RefreshToken(*url.URL, string) string {
|
||||||
func (scs staticCredentialStore) SetRefreshToken(*url.URL, string, string) {
|
func (scs staticCredentialStore) SetRefreshToken(*url.URL, string, string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type fallbackError struct {
|
|
||||||
err error
|
|
||||||
}
|
|
||||||
|
|
||||||
func (err fallbackError) Error() string {
|
|
||||||
return err.err.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
// loginV2 tries to login to the v2 registry server. The given registry
|
// loginV2 tries to login to the v2 registry server. The given registry
|
||||||
// endpoint will be pinged to get authorization challenges. These challenges
|
// endpoint will be pinged to get authorization challenges. These challenges
|
||||||
// will be used to authenticate against the registry to validate credentials.
|
// will be used to authenticate against the registry to validate credentials.
|
||||||
|
|
|
@ -175,23 +175,16 @@ func (s *defaultService) Search(ctx context.Context, term string, limit int, aut
|
||||||
modifiers := Headers(userAgent, nil)
|
modifiers := Headers(userAgent, nil)
|
||||||
v2Client, err := v2AuthHTTPClient(endpoint.URL, endpoint.client.Transport, modifiers, creds, scopes)
|
v2Client, err := v2AuthHTTPClient(endpoint.URL, endpoint.client.Transport, modifiers, creds, scopes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if fErr, ok := err.(fallbackError); ok {
|
return nil, err
|
||||||
logrus.WithError(fErr.err).Error("cannot use identity token for search, v2 auth not supported")
|
|
||||||
} else {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Copy non transport http client features
|
|
||||||
v2Client.Timeout = endpoint.client.Timeout
|
|
||||||
v2Client.CheckRedirect = endpoint.client.CheckRedirect
|
|
||||||
v2Client.Jar = endpoint.client.Jar
|
|
||||||
|
|
||||||
logrus.Debugf("using v2 client for search to %s", endpoint.URL)
|
|
||||||
client = v2Client
|
|
||||||
}
|
}
|
||||||
}
|
// Copy non transport http client features
|
||||||
|
v2Client.Timeout = endpoint.client.Timeout
|
||||||
|
v2Client.CheckRedirect = endpoint.client.CheckRedirect
|
||||||
|
v2Client.Jar = endpoint.client.Jar
|
||||||
|
|
||||||
if client == nil {
|
logrus.Debugf("using v2 client for search to %s", endpoint.URL)
|
||||||
|
client = v2Client
|
||||||
|
} else {
|
||||||
client = endpoint.client
|
client = endpoint.client
|
||||||
if err := authorizeClient(client, authConfig, endpoint); err != nil {
|
if err := authorizeClient(client, authConfig, endpoint); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue