MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / modifyHostOptionsForContainer

Function modifyHostOptionsForContainer

core/security_context.go:237–250  ·  view source on GitHub ↗

modifyHostOptionsForContainer applies NetworkMode/UTSMode to container's dockercontainer.HostConfig.

(
	nsOpts *runtimeapi.NamespaceOption,
	podSandboxID string,
	hc *dockercontainer.HostConfig,
)

Source from the content-addressed store, hash-verified

235
236// modifyHostOptionsForContainer applies NetworkMode/UTSMode to container's dockercontainer.HostConfig.
237func modifyHostOptionsForContainer(
238 nsOpts *runtimeapi.NamespaceOption,
239 podSandboxID string,
240 hc *dockercontainer.HostConfig,
241) {
242 sandboxNSMode := fmt.Sprintf("container:%v", podSandboxID)
243 hc.NetworkMode = dockercontainer.NetworkMode(sandboxNSMode)
244 hc.IpcMode = dockercontainer.IpcMode(sandboxNSMode)
245 hc.UTSMode = ""
246
247 if nsOpts.GetNetwork() == runtimeapi.NamespaceMode_NODE {
248 hc.UTSMode = namespaceModeHost
249 }
250}
251
252func getSeccompDockerOpts(seccomp *runtimeapi.SecurityProfile) ([]DockerOpt, error) {
253

Callers 2

updateCreateConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…