Skip to content

Commit

Permalink
libct/intelrdt: skip remove unless configured
Browse files Browse the repository at this point in the history
The OCI runtime spec mandates "[i]f intelRdt is not set, the runtime
MUST NOT manipulate any resctrl pseudo-filesystems." Attempting to
delete files counts as manipulating, so stop doing that when the
container's RDT configuration is nil.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 56daf36)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
corhere authored and lifubang committed Aug 10, 2023
1 parent 4796f49 commit 6cf9ac1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/intelrdt/intelrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func (m *Manager) Destroy() error {
// Don't remove resctrl group if closid has been explicitly specified. The
// group is likely externally managed, i.e. by some other entity than us.
// There are probably other containers/tasks sharing the same group.
if m.config.IntelRdt == nil || m.config.IntelRdt.ClosID == "" {
if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID == "" {
m.mu.Lock()
defer m.mu.Unlock()
if err := os.RemoveAll(m.GetPath()); err != nil {
Expand Down

0 comments on commit 6cf9ac1

Please sign in to comment.