Skip to content

Commit 768cd23

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 69f9565 commit 768cd23

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
@@ -479,7 +479,7 @@ func (m *Manager) Destroy() error {
479479
// Don't remove resctrl group if closid has been explicitly specified. The
480480
// group is likely externally managed, i.e. by some other entity than us.
481481
// There are probably other containers/tasks sharing the same group.
482-
if m.config.IntelRdt == nil || m.config.IntelRdt.ClosID == "" {
482+
if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID == "" {
483483
m.mu.Lock()
484484
defer m.mu.Unlock()
485485
if err := os.RemoveAll(m.GetPath()); err != nil {

0 commit comments

Comments
 (0)