Просмотр исходного кода

Merge pull request #45087 from corhere/fix-registry-config-locking

registry: acquire mutex in IsInsecureRegistry
Cory Snider 2 лет назад
Родитель
Сommit
e979518a69
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      registry/service.go

+ 2 - 0
registry/service.go

@@ -237,5 +237,7 @@ func (s *defaultService) LookupPushEndpoints(hostname string) (endpoints []APIEn
 // IsInsecureRegistry returns true if the registry at given host is configured as
 // IsInsecureRegistry returns true if the registry at given host is configured as
 // insecure registry.
 // insecure registry.
 func (s *defaultService) IsInsecureRegistry(host string) bool {
 func (s *defaultService) IsInsecureRegistry(host string) bool {
+	s.mu.RLock()
+	defer s.mu.RUnlock()
 	return !s.config.isSecureIndex(host)
 	return !s.config.isSecureIndex(host)
 }
 }