summaryrefslogtreecommitdiff
path: root/registry/service.go
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2023-02-28 19:42:49 -0500
committerCory Snider <csnider@mirantis.com>2023-02-28 19:42:49 -0500
commit19ad4ac03d801198fd7c3440a95f5334dcc9b117 (patch)
treee26fac87bd4109745bb49853f5fe9c39cf2967e3 /registry/service.go
parenta48f19157ad560fcb39e3b10fa0d6c331558998c (diff)
downloaddocker-19ad4ac03d801198fd7c3440a95f5334dcc9b117.tar.gz
registry: acquire mutex in IsInsecureRegistry
The mutex needs to be held when accessing s.config to prevent data races. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'registry/service.go')
-rw-r--r--registry/service.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/registry/service.go b/registry/service.go
index a505f00e7e..f12e10437f 100644
--- a/registry/service.go
+++ b/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
// insecure registry.
func (s *defaultService) IsInsecureRegistry(host string) bool {
+ s.mu.RLock()
+ defer s.mu.RUnlock()
return !s.config.isSecureIndex(host)
}