Skip to content

Commit e1824d2

Browse files
klihubmikebrow
authored andcommitted
cri,nri: pass any linux I/O priority to plugins.
Signed-off-by: Krisztian Litkey <[email protected]>
1 parent 01d5490 commit e1824d2

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

internal/cri/nri/nri_api_linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,13 @@ func (c *criContainer) GetCgroupsPath() string {
868868
return c.spec.Linux.CgroupsPath
869869
}
870870

871+
func (c *criContainer) GetIOPriority() *api.LinuxIOPriority {
872+
if c.spec.Process == nil {
873+
return nil
874+
}
875+
return api.FromOCILinuxIOPriority(c.spec.Process.IOPriority)
876+
}
877+
871878
func (c *criContainer) GetPid() uint32 {
872879
return c.pid
873880
}

internal/nri/container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type LinuxContainer interface {
4545
GetLinuxResources() *nri.LinuxResources
4646
GetOOMScoreAdj() *int
4747
GetCgroupsPath() string
48+
GetIOPriority() *nri.LinuxIOPriority
4849
}
4950

5051
func commonContainerToNRI(ctr Container) *nri.Container {

internal/nri/container_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func containerToNRI(ctr Container) *nri.Container {
3131
Resources: lnxCtr.GetLinuxResources(),
3232
OomScoreAdj: nri.Int(lnxCtr.GetOOMScoreAdj()),
3333
CgroupsPath: lnxCtr.GetCgroupsPath(),
34+
IoPriority: lnxCtr.GetIOPriority(),
3435
}
3536
return nriCtr
3637
}

0 commit comments

Comments
 (0)