Set the container hostnames same as pod hostname
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
7c6443c592
commit
4ccc5bbe7c
3 changed files with 7 additions and 0 deletions
|
@ -394,6 +394,10 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
|||
specgen.AddBindMount(sb.resolvPath, "/etc/resolv.conf", []string{"ro"})
|
||||
}
|
||||
|
||||
if sb.hostname != "" {
|
||||
specgen.SetHostname(sb.hostname)
|
||||
}
|
||||
|
||||
specgen.AddAnnotation("ocid/name", containerName)
|
||||
specgen.AddAnnotation("ocid/sandbox_id", sb.id)
|
||||
specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue