Only set sysctls for infra containers

This commit is contained in:
Dr. Stefan Schimanski 2016-09-09 15:51:12 +02:00
parent 6babfb6ccc
commit 962e7534b4

View File

@ -687,6 +687,7 @@ func (dm *DockerManager) runContainer(
}
// Set sysctls if requested
if container.Name == PodInfraContainerName {
sysctls, unsafeSysctls, err := api.SysctlsFromPodAnnotations(pod.Annotations)
if err != nil {
dm.recorder.Eventf(ref, api.EventTypeWarning, events.FailedToCreateContainer, "Failed to create docker container %q of pod %q with error: %v", container.Name, format.Pod(pod), err)
@ -701,6 +702,7 @@ func (dm *DockerManager) runContainer(
hc.Sysctls[c.Name] = c.Value
}
}
}
// If current api version is newer than docker 1.10 requested, set OomScoreAdj to HostConfig
result, err := dm.checkDockerAPIVersion(dockerV110APIVersion)