Browse Source

Merge pull request #1681 from krasi-georgiev/31610-ingress-sandbox-files-location-with-custom-daemon-root-directory

ingress sandbox hosts and resolve.conf files location didn't respect the custom daemon root directory
Alessandro Boch 8 năm trước cách đây
mục cha
commit
f95ae18294
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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"
@@ -979,6 +980,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()