From 5b9348c553d183bc62f6e7cc8f934766fac162bd Mon Sep 17 00:00:00 2001 From: allencloud Date: Wed, 21 Dec 2016 18:31:05 +0800 Subject: support registry mirror config reload Signed-off-by: allencloud --- registry/service.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'registry/service.go') diff --git a/registry/service.go b/registry/service.go index 596a9c7e5f..af74cbad26 100644 --- a/registry/service.go +++ b/registry/service.go @@ -31,6 +31,7 @@ type Service interface { Search(ctx context.Context, term string, limit int, authConfig *types.AuthConfig, userAgent string, headers map[string][]string) (*registrytypes.SearchResults, error) ServiceConfig() *registrytypes.ServiceConfig TLSConfig(hostname string) (*tls.Config, error) + LoadMirrors([]string) error LoadInsecureRegistries([]string) error } @@ -73,6 +74,14 @@ func (s *DefaultService) ServiceConfig() *registrytypes.ServiceConfig { return &servConfig } +// LoadMirrors loads registry mirrors for Service +func (s *DefaultService) LoadMirrors(mirrors []string) error { + s.mu.Lock() + defer s.mu.Unlock() + + return s.config.LoadMirrors(mirrors) +} + // LoadInsecureRegistries loads insecure registries for Service func (s *DefaultService) LoadInsecureRegistries(registries []string) error { s.mu.Lock() -- cgit v1.2.1