Skip to content

Commit

Permalink
move IntelRdtClosID to HostConfig
Browse files Browse the repository at this point in the history
Signed-off-by: Wolfgang Pross <[email protected]>
  • Loading branch information
wpross committed Sep 26, 2023
1 parent 8a978a8 commit f87a160
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 0 additions & 7 deletions libpod/container_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion libpod/container_inspect_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion libpod/define/container_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f87a160

Please sign in to comment.