mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Skip readonly controllers
Some system have controller directories created, but they are read-only. Handle that case and skip optional controllers. Closes #5887 PiperOrigin-RevId: 411907208
This commit is contained in:
committed by
gVisor bot
parent
2758e11230
commit
82fd0523dc
@@ -20,6 +20,7 @@ import (
|
||||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -445,7 +446,7 @@ func createController(c Cgroup, name string) (bool, error) {
|
||||
path := c.MakePath(name)
|
||||
log.Debugf("Creating cgroup %q: %q", name, path)
|
||||
if err := os.MkdirAll(path, 0755); err != nil {
|
||||
return false, err
|
||||
return errors.Is(err, unix.EROFS), err
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user