mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Merge pull request #34830 from feiskyer/sysctl
Automatic merge from submit-queue Add sysctls for dockershim This PR adds sysctls support for dockershim. All sysctls e2e tests are passed in my local settings. Note that sysctls runtimeAdmit is not included in this PR, it is addressed in #32803. cc/ @yujuhong @Random-Liu
This commit is contained in:
@@ -126,6 +126,13 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeApi
|
||||
Privileged: config.GetPrivileged(),
|
||||
}
|
||||
|
||||
// Set sysctls if requested
|
||||
sysctls, err := getSysctlsFromAnnotations(config.Annotations)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to get sysctls from annotations %v for container %q: %v", config.Annotations, config.Metadata.GetName(), err)
|
||||
}
|
||||
hc.Sysctls = sysctls
|
||||
|
||||
// Apply options derived from the sandbox config.
|
||||
if lc := sandboxConfig.GetLinux(); lc != nil {
|
||||
// Apply Cgroup options.
|
||||
@@ -170,7 +177,6 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeApi
|
||||
// Note: ShmSize is handled in kube_docker_client.go
|
||||
}
|
||||
|
||||
var err error
|
||||
hc.SecurityOpt, err = getContainerSecurityOpts(config.Metadata.GetName(), sandboxConfig, ds.seccompProfileRoot)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to generate container security options for container %q: %v", config.Metadata.GetName(), err)
|
||||
|
||||
Reference in New Issue
Block a user