Skip to content

Commit ddac682

Browse files
committed
libct/intelrdt: skip remove unless configured
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 <[email protected]>
1 parent 891fcc6 commit ddac682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcontainer/intelrdt/intelrdt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func (m *Manager) Destroy() error {
509509
// Don't remove resctrl group if closid has been explicitly specified. The
510510
// group is likely externally managed, i.e. by some other entity than us.
511511
// There are probably other containers/tasks sharing the same group.
512-
if m.config.IntelRdt == nil || m.config.IntelRdt.ClosID == "" {
512+
if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID == "" {
513513
m.mu.Lock()
514514
defer m.mu.Unlock()
515515
if err := os.RemoveAll(m.GetPath()); err != nil {

0 commit comments

Comments
 (0)