From 48a297ed7b6a64775e2fa603e8c98e2f8636a9cf Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 24 Mar 2017 15:32:16 +0100 Subject: [PATCH] container: Propagate the pod sandbox resolv.conf mount point When a pod sandbox comes with DNS settings, the resulting resolv.conf file needs to be bind mounted in all pod containers under /etc/resolv.conf. Signed-off-by: Samuel Ortiz --- server/container_create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/container_create.go b/server/container_create.go index 8ef2cce7..fe8b8c0a 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -407,6 +407,11 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string, // bind mount the pod shm specgen.AddBindMount(sb.shmPath, "/dev/shm", []string{"rw"}) + if sb.resolvPath != "" { + // bind mount the pod resolver file + specgen.AddBindMount(sb.resolvPath, "/etc/resolv.conf", []string{"ro"}) + } + specgen.AddAnnotation("ocid/name", containerName) specgen.AddAnnotation("ocid/sandbox_id", sb.id) specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name())