mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-11-06 20:33:57 +08:00
vendor: update buildkit to f238f1e
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
5
vendor/github.com/containerd/containerd/sys/filesys_unix.go
generated
vendored
5
vendor/github.com/containerd/containerd/sys/filesys_unix.go
generated
vendored
@@ -24,3 +24,8 @@ import "os"
|
||||
func ForceRemoveAll(path string) error {
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
|
||||
// MkdirAllWithACL is a wrapper for os.MkdirAll on Unix systems.
|
||||
func MkdirAllWithACL(path string, perm os.FileMode) error {
|
||||
return os.MkdirAll(path, perm)
|
||||
}
|
||||
|
||||
10
vendor/github.com/containerd/containerd/sys/filesys_windows.go
generated
vendored
10
vendor/github.com/containerd/containerd/sys/filesys_windows.go
generated
vendored
@@ -30,6 +30,11 @@ import (
|
||||
"github.com/Microsoft/hcsshim"
|
||||
)
|
||||
|
||||
const (
|
||||
// SddlAdministratorsLocalSystem is local administrators plus NT AUTHORITY\System
|
||||
SddlAdministratorsLocalSystem = "D:P(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)"
|
||||
)
|
||||
|
||||
// MkdirAllWithACL is a wrapper for MkdirAll that creates a directory
|
||||
// ACL'd for Builtin Administrators and Local System.
|
||||
func MkdirAllWithACL(path string, perm os.FileMode) error {
|
||||
@@ -78,7 +83,7 @@ func mkdirall(path string, adminAndLocalSystem bool) error {
|
||||
|
||||
if j > 1 {
|
||||
// Create parent
|
||||
err = mkdirall(path[0:j-1], false)
|
||||
err = mkdirall(path[0:j-1], adminAndLocalSystem)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -112,8 +117,7 @@ func mkdirall(path string, adminAndLocalSystem bool) error {
|
||||
// and Local System.
|
||||
func mkdirWithACL(name string) error {
|
||||
sa := syscall.SecurityAttributes{Length: 0}
|
||||
sddl := "D:P(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)"
|
||||
sd, err := winio.SddlToSecurityDescriptor(sddl)
|
||||
sd, err := winio.SddlToSecurityDescriptor(SddlAdministratorsLocalSystem)
|
||||
if err != nil {
|
||||
return &os.PathError{Op: "mkdir", Path: name, Err: err}
|
||||
}
|
||||
|
||||
12
vendor/github.com/containerd/containerd/sys/oom_unix.go
generated
vendored
12
vendor/github.com/containerd/containerd/sys/oom_unix.go
generated
vendored
@@ -20,8 +20,10 @@ package sys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/system"
|
||||
)
|
||||
@@ -45,3 +47,13 @@ func SetOOMScore(pid, score int) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetOOMScoreAdj gets the oom score for a process
|
||||
func GetOOMScoreAdj(pid int) (int, error) {
|
||||
path := fmt.Sprintf("/proc/%d/oom_score_adj", pid)
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return strconv.Atoi(strings.TrimSpace(string(data)))
|
||||
}
|
||||
|
||||
7
vendor/github.com/containerd/containerd/sys/oom_windows.go
generated
vendored
7
vendor/github.com/containerd/containerd/sys/oom_windows.go
generated
vendored
@@ -22,3 +22,10 @@ package sys
|
||||
func SetOOMScore(pid, score int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetOOMScoreAdj gets the oom score for a process
|
||||
//
|
||||
// Not implemented on Windows
|
||||
func GetOOMScoreAdj(pid int) (int, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user