diff options
author | Paweł Gronowski <pawel.gronowski@docker.com> | 2022-09-01 17:03:10 +0200 |
---|---|---|
committer | Djordje Lukic <djordje.lukic@docker.com> | 2023-01-11 17:00:27 +0100 |
commit | 9032e6779d9009a7d183670600a5f89e2ab6c295 (patch) | |
tree | b08b6324f6fb47126694b92ac9f2c1f601035846 /registry/service.go | |
parent | c83fce86d408439618e188bf9c581e4d127f91a3 (diff) | |
download | docker-9032e6779d9009a7d183670600a5f89e2ab6c295.tar.gz |
c8d/resolver: Fallback to http for insecure registries
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Diffstat (limited to 'registry/service.go')
-rw-r--r-- | registry/service.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/registry/service.go b/registry/service.go index a4453bb17a..a505f00e7e 100644 --- a/registry/service.go +++ b/registry/service.go @@ -26,6 +26,7 @@ type Service interface { LoadAllowNondistributableArtifacts([]string) error LoadMirrors([]string) error LoadInsecureRegistries([]string) error + IsInsecureRegistry(string) bool } // defaultService is a registry service. It tracks configuration data such as a list @@ -232,3 +233,9 @@ func (s *defaultService) LookupPushEndpoints(hostname string) (endpoints []APIEn } return endpoints, err } + +// IsInsecureRegistry returns true if the registry at given host is configured as +// insecure registry. +func (s *defaultService) IsInsecureRegistry(host string) bool { + return !s.config.isSecureIndex(host) +} |