Skip to content

Commit d7532de

Browse files
klihubmikebrow
authored andcommitted
cri,nri: pass any linux RDT constraints to plugins.
Signed-off-by: Krisztian Litkey <[email protected]>
1 parent ef36e61 commit d7532de

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

internal/cri/nri/nri_api_linux.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,17 @@ func (c *criContainer) GetNetDevices() map[string]*api.LinuxNetDevice {
889889
return api.FromOCILinuxNetDevices(c.spec.Linux.NetDevices)
890890
}
891891

892+
func (c *criContainer) GetRdt() *api.LinuxRdt {
893+
if c.spec.Linux == nil || c.spec.Linux.IntelRdt == nil {
894+
return nil
895+
}
896+
return &api.LinuxRdt{
897+
ClosId: api.String(c.spec.Linux.IntelRdt.ClosID),
898+
Schemata: api.RepeatedString(c.spec.Linux.IntelRdt.Schemata),
899+
EnableMonitoring: api.Bool(c.spec.Linux.IntelRdt.EnableMonitoring),
900+
}
901+
}
902+
892903
func (c *criContainer) GetPid() uint32 {
893904
return c.pid
894905
}

internal/nri/container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type LinuxContainer interface {
4848
GetIOPriority() *nri.LinuxIOPriority
4949
GetScheduler() *nri.LinuxScheduler
5050
GetNetDevices() map[string]*nri.LinuxNetDevice
51+
GetRdt() *nri.LinuxRdt
5152
}
5253

5354
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
@@ -34,6 +34,7 @@ func containerToNRI(ctr Container) *nri.Container {
3434
IoPriority: lnxCtr.GetIOPriority(),
3535
Scheduler: lnxCtr.GetScheduler(),
3636
NetDevices: lnxCtr.GetNetDevices(),
37+
Rdt: lnxCtr.GetRdt(),
3738
}
3839
return nriCtr
3940
}

0 commit comments

Comments
 (0)