mirror of
https://github.com/moby/buildkit.git
synced 2026-08-04 23:00:51 +00:00
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 <tonistiigi@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user