move IntelRdtClosID to HostConfig

Signed-off-by: Wolfgang Pross <wolfgang.pross@intel.com>
This commit is contained in:
Wolfgang Pross
2023-09-26 17:59:19 +00:00
parent 4853320ce1
commit bfbd0c8960
4 changed files with 11 additions and 10 deletions

View File

@@ -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() networkConfig, err := c.getContainerNetworkInfo()
if err != nil { if err != nil {
return nil, err return nil, err

View File

@@ -21,8 +21,14 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC
// there are things that require a major:minor to path translation. // there are things that require a major:minor to path translation.
var deviceNodes map[string]string var deviceNodes map[string]string
// Resource limits
if ctrSpec.Linux != nil { 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 != nil {
if ctrSpec.Linux.Resources.CPU != nil { if ctrSpec.Linux.Resources.CPU != nil {
if ctrSpec.Linux.Resources.CPU.Shares != nil { if ctrSpec.Linux.Resources.CPU.Shares != nil {

View File

@@ -229,7 +229,6 @@ type InspectContainerState struct {
RestoreLog string `json:"RestoreLog,omitempty"` RestoreLog string `json:"RestoreLog,omitempty"`
Restored bool `json:"Restored,omitempty"` Restored bool `json:"Restored,omitempty"`
StoppedByUser bool `json:"StoppedByUser,omitempty"` StoppedByUser bool `json:"StoppedByUser,omitempty"`
IntelRdtClosID string `json:"IntelRdtClosID,omitempty"`
} }
// Healthcheck returns the HealthCheckResults. This is used for old podman compat // Healthcheck returns the HealthCheckResults. This is used for old podman compat
@@ -568,6 +567,9 @@ type InspectContainerHostConfig struct {
IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"` IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"`
// CgroupConf is the configuration for cgroup v2. // CgroupConf is the configuration for cgroup v2.
CgroupConf map[string]string `json:"CgroupConf"` 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. // Address represents an IP address.

View File

@@ -84,7 +84,7 @@ var _ = Describe("Podman create", func() {
check := podmanTest.Podman([]string{"inspect", "rdt_test"}) check := podmanTest.Podman([]string{"inspect", "rdt_test"})
check.WaitWithDefaultTimeout() check.WaitWithDefaultTimeout()
data := check.InspectContainerToJSON() 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() { It("podman create adds annotation", func() {