Skip to content

Commit

Permalink
Merge pull request #44313 from tianon/20.10-distributable
Browse files Browse the repository at this point in the history
[20.10 backport] registry: allow "allow-nondistributable-artifacts" for Docker Hub
  • Loading branch information
thaJeztah committed Oct 19, 2022
2 parents 03df974 + 6699afa commit 2b7f97a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions registry/service_v2.go
Expand Up @@ -9,6 +9,9 @@ import (

func (s *DefaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndpoint, err error) {
tlsConfig := tlsconfig.ServerDefault()

ana := allowNondistributableArtifacts(s.config, hostname)

if hostname == DefaultNamespace || hostname == IndexHostname {
for _, mirror := range s.config.Mirrors {
if !strings.HasPrefix(mirror, "http://") && !strings.HasPrefix(mirror, "https://") {
Expand Down Expand Up @@ -36,13 +39,13 @@ func (s *DefaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndp
Official: true,
TrimHostname: true,
TLSConfig: tlsConfig,

AllowNondistributableArtifacts: ana,
})

return endpoints, nil
}

ana := allowNondistributableArtifacts(s.config, hostname)

tlsConfig, err = s.tlsConfig(hostname)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2b7f97a

Please sign in to comment.