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

registry: acquire mutex in IsInsecureRegistry
This commit is contained in:
Cory Snider 2023-03-01 09:10:25 -05:00 committed by GitHub
commit e979518a69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}