aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/opencontainers')
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go38
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go4
-rw-r--r--vendor/github.com/opencontainers/runtime-spec/specs-go/config.go17
3 files changed, 47 insertions, 12 deletions
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go
index 316d963d6..9717acc72 100644
--- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go
+++ b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go
@@ -14,6 +14,7 @@ import (
"time"
units "github.com/docker/go-units"
+ "golang.org/x/sys/unix"
)
const (
@@ -464,10 +465,39 @@ func WriteCgroupProc(dir string, pid int) error {
}
// Dont attach any pid to the cgroup if -1 is specified as a pid
- if pid != -1 {
- if err := ioutil.WriteFile(filepath.Join(dir, CgroupProcesses), []byte(strconv.Itoa(pid)), 0700); err != nil {
- return fmt.Errorf("failed to write %v to %v: %v", pid, CgroupProcesses, err)
+ if pid == -1 {
+ return nil
+ }
+
+ cgroupProcessesFile, err := os.OpenFile(filepath.Join(dir, CgroupProcesses), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700)
+ if err != nil {
+ return fmt.Errorf("failed to write %v to %v: %v", pid, CgroupProcesses, err)
+ }
+ defer cgroupProcessesFile.Close()
+
+ for i := 0; i < 5; i++ {
+ _, err = cgroupProcessesFile.WriteString(strconv.Itoa(pid))
+ if err == nil {
+ return nil
}
+
+ // EINVAL might mean that the task being added to cgroup.procs is in state
+ // TASK_NEW. We should attempt to do so again.
+ if isEINVAL(err) {
+ time.Sleep(30 * time.Millisecond)
+ continue
+ }
+
+ return fmt.Errorf("failed to write %v to %v: %v", pid, CgroupProcesses, err)
+ }
+ return err
+}
+
+func isEINVAL(err error) bool {
+ switch err := err.(type) {
+ case *os.PathError:
+ return err.Err == unix.EINVAL
+ default:
+ return false
}
- return nil
}
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go b/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go
index 6f47aac07..57e9f037d 100644
--- a/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go
+++ b/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go
@@ -5,7 +5,9 @@ type IntelRdt struct {
// Format: "L3:<cache_id0>=<cbm0>;<cache_id1>=<cbm1>;..."
L3CacheSchema string `json:"l3_cache_schema,omitempty"`
- // The schema of memory bandwidth percentage per L3 cache id
+ // The schema of memory bandwidth per L3 cache id
// Format: "MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;..."
+ // The unit of memory bandwidth is specified in "percentages" by
+ // default, and in "MBps" if MBA Software Controller is enabled.
MemBwSchema string `json:"memBwSchema,omitempty"`
}
diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
index 6d791e7e9..48e621c99 100644
--- a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
+++ b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
@@ -38,7 +38,9 @@ type Process struct {
// User specifies user information for the process.
User User `json:"user"`
// Args specifies the binary and arguments for the application to execute.
- Args []string `json:"args"`
+ Args []string `json:"args,omitempty"`
+ // CommandLine specifies the full command line for the application to execute on Windows.
+ CommandLine string `json:"commandLine,omitempty" platform:"windows"`
// Env populates the process environment for the process.
Env []string `json:"env,omitempty"`
// Cwd is the current working directory for the process and must be
@@ -181,17 +183,17 @@ const (
// PIDNamespace for isolating process IDs
PIDNamespace LinuxNamespaceType = "pid"
// NetworkNamespace for isolating network devices, stacks, ports, etc
- NetworkNamespace = "network"
+ NetworkNamespace LinuxNamespaceType = "network"
// MountNamespace for isolating mount points
- MountNamespace = "mount"
+ MountNamespace LinuxNamespaceType = "mount"
// IPCNamespace for isolating System V IPC, POSIX message queues
- IPCNamespace = "ipc"
+ IPCNamespace LinuxNamespaceType = "ipc"
// UTSNamespace for isolating hostname and NIS domain name
- UTSNamespace = "uts"
+ UTSNamespace LinuxNamespaceType = "uts"
// UserNamespace for isolating user and group IDs
- UserNamespace = "user"
+ UserNamespace LinuxNamespaceType = "user"
// CgroupNamespace for isolating cgroup hierarchies
- CgroupNamespace = "cgroup"
+ CgroupNamespace LinuxNamespaceType = "cgroup"
)
// LinuxIDMapping specifies UID/GID mappings
@@ -217,6 +219,7 @@ type POSIXRlimit struct {
// LinuxHugepageLimit structure corresponds to limiting kernel hugepages
type LinuxHugepageLimit struct {
// Pagesize is the hugepage size
+ // Format: "<size><unit-prefix>B' (e.g. 64KB, 2MB, 1GB, etc.)
Pagesize string `json:"pageSize"`
// Limit is the limit of "hugepagesize" hugetlb usage
Limit uint64 `json:"limit"`