daemon/RegistryHosts: Don't lose mirrors
`docker.io` is present in the `IndexConfigs` so the `Mirrors` property would get lost because a fresh `RegistryConfig` object was created. Instead of creating a new object, reuse the existing one and just mutate its fields. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
a67b7554c8
commit
d871a665de
1 changed files with 2 additions and 3 deletions
|
@ -196,7 +196,7 @@ func (daemon *Daemon) RegistryHosts(host string) ([]docker.RegistryHost, error)
|
|||
}
|
||||
conf := daemon.registryService.ServiceConfig().IndexConfigs
|
||||
for k, v := range conf {
|
||||
c := resolverconfig.RegistryConfig{}
|
||||
c := m[k]
|
||||
if !v.Secure {
|
||||
t := true
|
||||
c.PlainHTTP = &t
|
||||
|
@ -204,8 +204,7 @@ func (daemon *Daemon) RegistryHosts(host string) ([]docker.RegistryHost, error)
|
|||
}
|
||||
m[k] = c
|
||||
}
|
||||
if _, ok := m[host]; !ok && daemon.registryService.IsInsecureRegistry(host) {
|
||||
c := resolverconfig.RegistryConfig{}
|
||||
if c, ok := m[host]; !ok && daemon.registryService.IsInsecureRegistry(host) {
|
||||
t := true
|
||||
c.PlainHTTP = &t
|
||||
c.Insecure = &t
|
||||
|
|
Loading…
Add table
Reference in a new issue