Explorar el Código

daemon: support using CIDR notation for getting registry hosts

insecure-registries supports using CIDR notation, however, buildkit in
moby was not respecting these. We can update the RegistryHosts function
to support this by inserting the correct host into the lookup map if
it's explicitly marked as insecure.

Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell hace 2 años
padre
commit
eb68c5e747
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      daemon/daemon.go

+ 7 - 0
daemon/daemon.go

@@ -207,6 +207,13 @@ func (daemon *Daemon) RegistryHosts(host string) ([]docker.RegistryHost, error)
 		}
 		}
 		m[k] = c
 		m[k] = c
 	}
 	}
+	if _, ok := m[host]; !ok && daemon.registryService.IsInsecureRegistry(host) {
+		c := resolverconfig.RegistryConfig{}
+		t := true
+		c.PlainHTTP = &t
+		c.Insecure = &t
+		m[host] = c
+	}
 
 
 	for k, v := range m {
 	for k, v := range m {
 		v.TLSConfigDir = []string{registry.HostCertsDir(k)}
 		v.TLSConfigDir = []string{registry.HostCertsDir(k)}