Skip to content

Commit fca346f

Browse files
committed
allow ENOTSUP for PSI cgroup files
If kernel is configured with CONFIG_PSI_DEFAULT_DISABLED then PSI files exist but are unreadable. Signed-off-by: Tonis Tiigi <[email protected]>
1 parent c6a1835 commit fca346f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

executor/resources/cpu.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"path/filepath"
77
"strconv"
88
"strings"
9+
"syscall"
910

1011
"github.com/moby/buildkit/executor/resources/types"
1112
"github.com/pkg/errors"
@@ -81,7 +82,7 @@ func getCgroupCPUStat(cgroupPath string) (*types.CPUStat, error) {
8182
func parsePressureFile(filename string) (*types.Pressure, error) {
8283
content, err := os.ReadFile(filename)
8384
if err != nil {
84-
if errors.Is(err, os.ErrNotExist) { // pressure file requires CONFIG_PSI
85+
if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTSUP) { // pressure file requires CONFIG_PSI
8586
return nil, nil
8687
}
8788
return nil, err

0 commit comments

Comments
 (0)