Skip to content

Commit bfbd0c8

Browse files
committed
move IntelRdtClosID to HostConfig
Signed-off-by: Wolfgang Pross <[email protected]>
1 parent 4853320 commit bfbd0c8

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

libpod/container_inspect.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver
198198
}
199199
}
200200

201-
if ctrSpec.Linux.IntelRdt != nil {
202-
if ctrSpec.Linux.IntelRdt.ClosID != "" {
203-
// container is assigned to a ClosID
204-
data.State.IntelRdtClosID = ctrSpec.Linux.IntelRdt.ClosID
205-
}
206-
}
207-
208201
networkConfig, err := c.getContainerNetworkInfo()
209202
if err != nil {
210203
return nil, err

libpod/container_inspect_linux.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC
2121
// there are things that require a major:minor to path translation.
2222
var deviceNodes map[string]string
2323

24-
// Resource limits
2524
if ctrSpec.Linux != nil {
25+
if ctrSpec.Linux.IntelRdt != nil {
26+
if ctrSpec.Linux.IntelRdt.ClosID != "" {
27+
// container is assigned to a ClosID
28+
hostConfig.IntelRdtClosID = ctrSpec.Linux.IntelRdt.ClosID
29+
}
30+
}
31+
// Resource limits
2632
if ctrSpec.Linux.Resources != nil {
2733
if ctrSpec.Linux.Resources.CPU != nil {
2834
if ctrSpec.Linux.Resources.CPU.Shares != nil {

libpod/define/container_inspect.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ type InspectContainerState struct {
229229
RestoreLog string `json:"RestoreLog,omitempty"`
230230
Restored bool `json:"Restored,omitempty"`
231231
StoppedByUser bool `json:"StoppedByUser,omitempty"`
232-
IntelRdtClosID string `json:"IntelRdtClosID,omitempty"`
233232
}
234233

235234
// Healthcheck returns the HealthCheckResults. This is used for old podman compat
@@ -568,6 +567,9 @@ type InspectContainerHostConfig struct {
568567
IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"`
569568
// CgroupConf is the configuration for cgroup v2.
570569
CgroupConf map[string]string `json:"CgroupConf"`
570+
// IntelRdtClosID defines the Intel RDT CAT Class Of Service (COS) that
571+
// all processes of the container should run in.
572+
IntelRdtClosID string `json:"IntelRdtClosID,omitempty"`
571573
}
572574

573575
// Address represents an IP address.

test/e2e/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var _ = Describe("Podman create", func() {
8484
check := podmanTest.Podman([]string{"inspect", "rdt_test"})
8585
check.WaitWithDefaultTimeout()
8686
data := check.InspectContainerToJSON()
87-
Expect(data[0].State.IntelRdtClosID).To(Equal("COS1"))
87+
Expect(data[0].HostConfig.IntelRdtClosID).To(Equal("COS1"))
8888
})
8989

9090
It("podman create adds annotation", func() {

0 commit comments

Comments
 (0)