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 <sameo@linux.intel.com>
This commit is contained in:
parent
72129ee3fb
commit
48a297ed7b
1 changed files with 5 additions and 0 deletions
|
@ -407,6 +407,11 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
||||||
// bind mount the pod shm
|
// bind mount the pod shm
|
||||||
specgen.AddBindMount(sb.shmPath, "/dev/shm", []string{"rw"})
|
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/name", containerName)
|
||||||
specgen.AddAnnotation("ocid/sandbox_id", sb.id)
|
specgen.AddAnnotation("ocid/sandbox_id", sb.id)
|
||||||
specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name())
|
specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name())
|
||||||
|
|
Loading…
Reference in a new issue