pass sysctls down to oci runtime
Signed-off-by: HaoZhang <crazykev@zju.edu.cn>
This commit is contained in:
parent
2e3ad167bb
commit
d1e1b7c183
2 changed files with 73 additions and 0 deletions
|
@ -188,6 +188,18 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
|||
g.AddAnnotation(k, v)
|
||||
}
|
||||
|
||||
// extract linux sysctls from annotations and pass down to oci runtime
|
||||
safe, unsafe, err := SysctlsFromPodAnnotations(annotations)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, sysctl := range safe {
|
||||
g.AddLinuxSysctl(sysctl.Name, sysctl.Value)
|
||||
}
|
||||
for _, sysctl := range unsafe {
|
||||
g.AddLinuxSysctl(sysctl.Name, sysctl.Value)
|
||||
}
|
||||
|
||||
// setup cgroup settings
|
||||
cgroupParent := req.GetConfig().GetLinux().GetCgroupParent()
|
||||
if cgroupParent != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue