Skip to content

Commit 24d7f2d

Browse files
Add comments (notes).
1 parent b342dd1 commit 24d7f2d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

containerd/containerd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskC
186186
mounts = append(mounts, allocMount)
187187
}
188188

189+
// User will specify extra_hosts to be added to container's /etc/hosts.
190+
// If host_network=true, extra_hosts will be added to host's /etc/hosts.
191+
// If host_network=false, extra hosts will be added to the default /etc/hosts provided to the container.
192+
// If the user doesn't set anything (host_network, extra_hosts), a default /etc/hosts will be provided to the container.
189193
var extraHostsMount specs.Mount
190194
hostsFile := containerConfig.TaskDirSrc + "/etc_hosts"
191195
if len(config.ExtraHosts) > 0 {

etchosts/etchosts.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func BuildEtcHosts(hostsFile string) error {
4747
return err
4848
}
4949
}
50-
5150
return ioutil.WriteFile(hostsFile, content.Bytes(), 0644)
5251
}
5352

0 commit comments

Comments
 (0)