diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 736c191466..bb6fc7f543 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -198,13 +198,6 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver } } - if ctrSpec.Linux.IntelRdt != nil { - if ctrSpec.Linux.IntelRdt.ClosID != "" { - // container is assigned to a ClosID - data.State.IntelRdtClosID = ctrSpec.Linux.IntelRdt.ClosID - } - } - networkConfig, err := c.getContainerNetworkInfo() if err != nil { return nil, err diff --git a/libpod/container_inspect_linux.go b/libpod/container_inspect_linux.go index 2dae35922f..53fb04034b 100644 --- a/libpod/container_inspect_linux.go +++ b/libpod/container_inspect_linux.go @@ -21,8 +21,14 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC // there are things that require a major:minor to path translation. var deviceNodes map[string]string - // Resource limits if ctrSpec.Linux != nil { + if ctrSpec.Linux.IntelRdt != nil { + if ctrSpec.Linux.IntelRdt.ClosID != "" { + // container is assigned to a ClosID + hostConfig.IntelRdtClosID = ctrSpec.Linux.IntelRdt.ClosID + } + } + // Resource limits if ctrSpec.Linux.Resources != nil { if ctrSpec.Linux.Resources.CPU != nil { if ctrSpec.Linux.Resources.CPU.Shares != nil { diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index 78b3a2aeda..879dd13959 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -229,7 +229,6 @@ type InspectContainerState struct { RestoreLog string `json:"RestoreLog,omitempty"` Restored bool `json:"Restored,omitempty"` StoppedByUser bool `json:"StoppedByUser,omitempty"` - IntelRdtClosID string `json:"IntelRdtClosID,omitempty"` } // Healthcheck returns the HealthCheckResults. This is used for old podman compat @@ -568,6 +567,9 @@ type InspectContainerHostConfig struct { IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"` // CgroupConf is the configuration for cgroup v2. CgroupConf map[string]string `json:"CgroupConf"` + // IntelRdtClosID defines the Intel RDT CAT Class Of Service (COS) that + // all processes of the container should run in. + IntelRdtClosID string `json:"IntelRdtClosID,omitempty"` } // Address represents an IP address. diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 10d0de2373..2ec49b2794 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -84,7 +84,7 @@ var _ = Describe("Podman create", func() { check := podmanTest.Podman([]string{"inspect", "rdt_test"}) check.WaitWithDefaultTimeout() data := check.InspectContainerToJSON() - Expect(data[0].State.IntelRdtClosID).To(Equal("COS1")) + Expect(data[0].HostConfig.IntelRdtClosID).To(Equal("COS1")) }) It("podman create adds annotation", func() {