Procházet zdrojové kódy

don't add /etc/hosts record if ip is empty (issue #1146)

Signed-off-by: Andrei Ushakov <aushakov@netflix.com>
Andrei Ushakov před 9 roky
rodič
revize
e57d2f987d
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      libnetwork/sandbox_dns_unix.go

+ 4 - 0
libnetwork/sandbox_dns_unix.go

@@ -90,6 +90,10 @@ func (sb *sandbox) buildHostsFile() error {
 func (sb *sandbox) updateHostsFile(ifaceIP string) error {
 	var mhost string
 
+	if ifaceIP == "" {
+		return nil
+	}
+
 	if sb.config.originHostsPath != "" {
 		return nil
 	}