コード例 #1
0
ファイル: docker_sandbox.go プロジェクト: humblec/kubernetes
// applySandboxLinuxOptions applies LinuxPodSandboxConfig to dockercontainer.HostConfig and dockercontainer.ContainerCreateConfig.
func (ds *dockerService) applySandboxLinuxOptions(hc *dockercontainer.HostConfig, lc *runtimeApi.LinuxPodSandboxConfig, createConfig *dockertypes.ContainerCreateConfig, image string) error {
	// Apply Cgroup options.
	// TODO: Check if this works with per-pod cgroups.
	hc.CgroupParent = lc.GetCgroupParent()
	// Apply security context.
	applySandboxSecurityContext(lc, createConfig.Config, hc)

	return nil
}
コード例 #2
0
ファイル: docker_sandbox.go プロジェクト: spxtr/kubernetes
// applySandboxLinuxOptions applies LinuxPodSandboxConfig to dockercontainer.HostConfig and dockercontainer.ContainerCreateConfig.
func (ds *dockerService) applySandboxLinuxOptions(hc *dockercontainer.HostConfig, lc *runtimeapi.LinuxPodSandboxConfig, createConfig *dockertypes.ContainerCreateConfig, image string) error {
	// Apply Cgroup options.
	cgroupParent, err := ds.GenerateExpectedCgroupParent(lc.GetCgroupParent())
	if err != nil {
		return err
	}
	hc.CgroupParent = cgroupParent
	// Apply security context.
	applySandboxSecurityContext(lc, createConfig.Config, hc, ds.networkPlugin)

	return nil
}