cni: pass in the cgroupPath capability argument

There is a new CNI capability argument, cgroupPath, where runtimes can
pass cgroup paths to CNI plugins.

Implement that.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
This commit is contained in:
Casey Callendrello 2023-02-08 15:57:30 +01:00
parent d14758b605
commit 0166783c79
2 changed files with 8 additions and 0 deletions

View File

@ -396,6 +396,10 @@ func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.Namesp
opts = append(opts, cni.WithCapabilityDNS(*dns))
}
if cgroup := config.GetLinux().GetCgroupParent(); cgroup != "" {
opts = append(opts, cni.WithCapabilityCgroupPath(cgroup))
}
return opts, nil
}

View File

@ -597,6 +597,10 @@ func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.Namesp
opts = append(opts, cni.WithCapabilityDNS(*dns))
}
if cgroup := config.GetLinux().GetCgroupParent(); cgroup != "" {
opts = append(opts, cni.WithCapabilityCgroupPath(cgroup))
}
return opts, nil
}