daemon: remove dead code relying on SecondaryIPAddress

Since commit d0e0c13b60, `NetworkSettings.SecondaryAddress` is never
written.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton 2023-09-12 18:28:59 +02:00 committed by Sebastiaan van Stijn
parent b7ba0615d0
commit 9b184e1268
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -71,16 +71,6 @@ func (daemon *Daemon) buildSandboxOptions(cfg *config.Config, container *contain
sboxOptions = append(sboxOptions, libnetwork.OptionDNSOptions(cfg.DNSOptions))
}
if container.NetworkSettings.SecondaryIPAddresses != nil {
name := container.Config.Hostname
if container.Config.Domainname != "" {
name = name + "." + container.Config.Domainname
}
for _, a := range container.NetworkSettings.SecondaryIPAddresses {
sboxOptions = append(sboxOptions, libnetwork.OptionExtraHost(name, a.Addr))
}
}
for _, extraHost := range container.HostConfig.ExtraHosts {
// allow IPv6 addresses in extra hosts; only split on first ":"
if _, err := opts.ValidateExtraHost(extraHost); err != nil {