Sfoglia il codice sorgente

ingress sandbox hosts and resolve.conf files location didn't respect the custom daemon root directory

Signed-off-by: Krasi Georgiev <krasi@vip-consult.solutions>
Krasi Georgiev 8 anni fa
parent
commit
421c089e98
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      libnetwork/controller.go

+ 3 - 0
libnetwork/controller.go

@@ -47,6 +47,7 @@ import (
 	"container/heap"
 	"fmt"
 	"net"
+	"path/filepath"
 	"strings"
 	"sync"
 	"time"
@@ -957,6 +958,8 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
 
 	if sb.ingress {
 		c.ingressSandbox = sb
+		sb.config.hostsPath = filepath.Join(c.cfg.Daemon.DataDir, "/network/files/hosts")
+		sb.config.resolvConfPath = filepath.Join(c.cfg.Daemon.DataDir, "/network/files/resolv.conf")
 		sb.id = "ingress_sbox"
 	}
 	c.Unlock()