From fca346fff8155abfe13b452d8ba02cb5fdf5bb02 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 6 Jul 2023 22:49:39 -0700 Subject: [PATCH] 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 --- executor/resources/cpu.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/executor/resources/cpu.go b/executor/resources/cpu.go index c51ebe4d6..53d31f477 100644 --- a/executor/resources/cpu.go +++ b/executor/resources/cpu.go @@ -6,6 +6,7 @@ import ( "path/filepath" "strconv" "strings" + "syscall" "github.com/moby/buildkit/executor/resources/types" "github.com/pkg/errors" @@ -81,7 +82,7 @@ func getCgroupCPUStat(cgroupPath string) (*types.CPUStat, error) { func parsePressureFile(filename string) (*types.Pressure, error) { content, err := os.ReadFile(filename) if err != nil { - if errors.Is(err, os.ErrNotExist) { // pressure file requires CONFIG_PSI + if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTSUP) { // pressure file requires CONFIG_PSI return nil, nil } return nil, err