registry: newV1Endpoint: make it clear we skip validation for Docker Hub
validateEndpoint uses `v1Endpoint.ping` to verify if the search API can use a secure connection, and to fall back to basic auth. For Docker Hub, we don't allow insecure connections, and `v1Endpoint.ping` will not connect to Docker Hub (Docker Hub also does not implement the `_ping` endpoint, so doing so would always fail). Let's make it more clear that we don't do any validation, and return early. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7e506f71f3
commit
550e628f05
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ func newV1Endpoint(index *registry.IndexInfo, headers http.Header) (*v1Endpoint,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if endpoint.String() == IndexServer {
|
||||
// Skip the check, we know this one is valid
|
||||
// (and we never want to fall back to http in case of error)
|
||||
return endpoint, nil
|
||||
}
|
||||
|
||||
err = validateEndpoint(endpoint)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue