File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ type LinuxContainer interface {
3131 GetOOMScoreAdj () * int
3232 GetCgroupsPath () string
3333 GetIOPriority () * nri.LinuxIOPriority
34+ GetScheduler () * nri.LinuxScheduler
3435}
3536
3637func containerToNRI (ctr Container ) * nri.Container {
Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ func linuxContainerToNRI(ctr Container) *nri.LinuxContainer {
1616 OomScoreAdj : nri .Int (lnx .GetOOMScoreAdj ()),
1717 CgroupsPath : lnx .GetCgroupsPath (),
1818 IoPriority : lnx .GetIOPriority (),
19+ Scheduler : lnx .GetScheduler (),
1920 }
2021}
Original file line number Diff line number Diff line change @@ -780,6 +780,15 @@ func (c *criContainer) GetIOPriority() *api.LinuxIOPriority {
780780 return api .FromOCILinuxIOPriority (spec .Process .IOPriority )
781781}
782782
783+ func (c * criContainer ) GetScheduler () * api.LinuxScheduler {
784+ spec := c .GetSpec ()
785+ if spec .Process == nil || spec .Process .Scheduler == nil {
786+ return nil
787+ }
788+
789+ return api .FromOCILinuxScheduler (spec .Process .Scheduler )
790+ }
791+
783792func (c * criContainer ) GetSpec () * rspec.Spec {
784793 if c .spec != nil {
785794 return c .spec
You can’t perform that action at this time.
0 commit comments