mirror of
https://github.com/containers/podman.git
synced 2025-12-10 15:47:46 +08:00
move IntelRdtClosID to HostConfig
Signed-off-by: Wolfgang Pross <wolfgang.pross@intel.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user