Add linux resource oci.SpecOpts

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2020-03-05 13:02:10 -05:00
parent ca66f3dd5d
commit a3ca8a0dfc
2 changed files with 76 additions and 0 deletions

View File

@@ -91,6 +91,21 @@ func setResources(s *Spec) {
}
}
// nolint
func setCPU(s *Spec) {
setResources(s)
if s.Linux != nil {
if s.Linux.Resources.CPU == nil {
s.Linux.Resources.CPU = &specs.LinuxCPU{}
}
}
if s.Windows != nil {
if s.Windows.Resources.CPU == nil {
s.Windows.Resources.CPU = &specs.WindowsCPUResources{}
}
}
}
// setCapabilities sets Linux Capabilities to empty if unset
func setCapabilities(s *Spec) {
setProcess(s)