From dbc1fb37d0ab04e62b197b19fb6a78abadea81eb Mon Sep 17 00:00:00 2001 From: Li Yuxuan Date: Tue, 26 Nov 2019 18:34:53 +0800 Subject: [PATCH] Provide resolvConf to sandbox container's mounts As https://github.com/kata-containers/runtime/issues/1603 discussed, kata relies on such mount spec to setup resolv.conf for pod VM properly. Signed-off-by: Li Yuxuan --- pkg/server/sandbox_run_unix.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/server/sandbox_run_unix.go b/pkg/server/sandbox_run_unix.go index 9bcd94d1b..f8d690907 100644 --- a/pkg/server/sandbox_run_unix.go +++ b/pkg/server/sandbox_run_unix.go @@ -108,6 +108,13 @@ func (c *criService) sandboxContainerSpec(id string, config *runtime.PodSandboxC Type: "bind", Options: []string{"rbind", "ro"}, }, + // Add resolv.conf for katacontainers to setup the DNS of pod VM properly. + { + Source: c.getResolvPath(id), + Destination: resolvConfPath, + Type: "bind", + Options: []string{"rbind", "ro"}, + }, })) selinuxOpt := securityContext.GetSelinuxOptions()