Skip to content

Commit d5d655e

Browse files
askervinklihub
authored andcommitted
Add new IntelRdt.EnableMonitoring field
Signed-off-by: Antti Kervinen <[email protected]>
1 parent 8ad6f3b commit d5d655e

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

pkg/cdi/container-edits_test.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,17 +532,19 @@ func TestApplyContainerEdits(t *testing.T) {
532532
spec: &oci.Spec{},
533533
edits: &cdi.ContainerEdits{
534534
IntelRdt: &cdi.IntelRdt{
535-
ClosID: "clos-1",
536-
L3CacheSchema: "L3:0=ff;1=ff",
537-
MemBwSchema: "MB:0=50;1=50",
535+
ClosID: "clos-1",
536+
L3CacheSchema: "L3:0=ff;1=ff",
537+
MemBwSchema: "MB:0=50;1=50",
538+
EnableMonitoring: true,
538539
},
539540
},
540541
result: &oci.Spec{
541542
Linux: &oci.Linux{
542543
IntelRdt: &oci.LinuxIntelRdt{
543-
ClosID: "clos-1",
544-
L3CacheSchema: "L3:0=ff;1=ff",
545-
MemBwSchema: "MB:0=50;1=50",
544+
ClosID: "clos-1",
545+
L3CacheSchema: "L3:0=ff;1=ff",
546+
MemBwSchema: "MB:0=50;1=50",
547+
EnableMonitoring: true,
546548
},
547549
},
548550
},
@@ -552,9 +554,10 @@ func TestApplyContainerEdits(t *testing.T) {
552554
spec: &oci.Spec{
553555
Linux: &oci.Linux{
554556
IntelRdt: &oci.LinuxIntelRdt{
555-
ClosID: "clos-1",
556-
L3CacheSchema: "L3:0=ff",
557-
MemBwSchema: "MB:0=100",
557+
ClosID: "clos-1",
558+
L3CacheSchema: "L3:0=ff",
559+
MemBwSchema: "MB:0=100",
560+
EnableMonitoring: true,
558561
},
559562
},
560563
},

pkg/cdi/oci.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ func (d *DeviceNode) toOCI() spec.LinuxDevice {
5656
// toOCI returns the opencontainers runtime Spec LinuxIntelRdt for this IntelRdt config.
5757
func (i *IntelRdt) toOCI() *spec.LinuxIntelRdt {
5858
return &spec.LinuxIntelRdt{
59-
ClosID: i.ClosID,
60-
L3CacheSchema: i.L3CacheSchema,
61-
MemBwSchema: i.MemBwSchema,
59+
ClosID: i.ClosID,
60+
L3CacheSchema: i.L3CacheSchema,
61+
MemBwSchema: i.MemBwSchema,
62+
EnableMonitoring: i.EnableMonitoring,
6263
}
6364
}

specs-go/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ type Hook struct {
6464

6565
// IntelRdt describes the Linux IntelRdt parameters to set in the OCI spec.
6666
type IntelRdt struct {
67-
ClosID string `json:"closID,omitempty" yaml:"closID,omitempty"`
68-
L3CacheSchema string `json:"l3CacheSchema,omitempty" yaml:"l3CacheSchema,omitempty"`
69-
MemBwSchema string `json:"memBwSchema,omitempty" yaml:"memBwSchema,omitempty"`
67+
ClosID string `json:"closID,omitempty" yaml:"closID,omitempty"`
68+
L3CacheSchema string `json:"l3CacheSchema,omitempty" yaml:"l3CacheSchema,omitempty"`
69+
MemBwSchema string `json:"memBwSchema,omitempty" yaml:"memBwSchema,omitempty"`
70+
EnableMonitoring bool `json:"enableMonitoring,omitempty" yaml:"enableMonitoring,omitempty"`
7071
}

0 commit comments

Comments
 (0)