mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit db304eb93126 (v0.13.0-dev)
full diff: d6e142600e...db304eb931
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
8
vendor/github.com/prometheus/procfs/proc_cgroups.go
generated
vendored
8
vendor/github.com/prometheus/procfs/proc_cgroups.go
generated
vendored
@ -46,7 +46,7 @@ func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) {
|
||||
fields := strings.Fields(CgroupSummaryStr)
|
||||
// require at least 4 fields
|
||||
if len(fields) < 4 {
|
||||
return nil, fmt.Errorf("at least 4 fields required, found %d fields in cgroup info string: %s", len(fields), CgroupSummaryStr)
|
||||
return nil, fmt.Errorf("%w: 4+ fields required, found %d fields in cgroup info string: %s", ErrFileParse, len(fields), CgroupSummaryStr)
|
||||
}
|
||||
|
||||
CgroupSummary := &CgroupSummary{
|
||||
@ -54,15 +54,15 @@ func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) {
|
||||
}
|
||||
CgroupSummary.Hierarchy, err = strconv.Atoi(fields[1])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse hierarchy ID")
|
||||
return nil, fmt.Errorf("%w: Unable to parse hierarchy ID from %q", ErrFileParse, fields[1])
|
||||
}
|
||||
CgroupSummary.Cgroups, err = strconv.Atoi(fields[2])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse Cgroup Num")
|
||||
return nil, fmt.Errorf("%w: Unable to parse Cgroup Num from %q", ErrFileParse, fields[2])
|
||||
}
|
||||
CgroupSummary.Enabled, err = strconv.Atoi(fields[3])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse Enabled")
|
||||
return nil, fmt.Errorf("%w: Unable to parse Enabled from %q", ErrFileParse, fields[3])
|
||||
}
|
||||
return CgroupSummary, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user