Merge pull request #1233 from WeiZhang555/bump-runtime-spec
Bump runtime-spec to v1.0.0-rc3
This commit is contained in:
commit
9a1e53eafc
|
@ -59,8 +59,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/opencontainers/runtime-spec/specs-go",
|
"ImportPath": "github.com/opencontainers/runtime-spec/specs-go",
|
||||||
"Comment": "v1.0.0-rc2-38-g1c7c27d",
|
"Comment": "v1.0.0-rc3",
|
||||||
"Rev": "1c7c27d043c2a5e513a44084d2b10d77d1402b8c"
|
"Rev": "794ca7ac88234607f9d2c76da8a6e9bbbade8cb9"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/seccomp/libseccomp-golang",
|
"ImportPath": "github.com/seccomp/libseccomp-golang",
|
||||||
|
|
212
Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/config.go
generated
vendored
212
Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/config.go
generated
vendored
|
@ -47,7 +47,7 @@ type Process struct {
|
||||||
// Capabilities are Linux capabilities that are kept for the container.
|
// Capabilities are Linux capabilities that are kept for the container.
|
||||||
Capabilities []string `json:"capabilities,omitempty" platform:"linux"`
|
Capabilities []string `json:"capabilities,omitempty" platform:"linux"`
|
||||||
// Rlimits specifies rlimit options to apply to the process.
|
// Rlimits specifies rlimit options to apply to the process.
|
||||||
Rlimits []Rlimit `json:"rlimits,omitempty" platform:"linux"`
|
Rlimits []LinuxRlimit `json:"rlimits,omitempty" platform:"linux"`
|
||||||
// NoNewPrivileges controls whether additional privileges could be gained by processes in the container.
|
// NoNewPrivileges controls whether additional privileges could be gained by processes in the container.
|
||||||
NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"`
|
NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"`
|
||||||
// ApparmorProfile specifies the apparmor profile for the container.
|
// ApparmorProfile specifies the apparmor profile for the container.
|
||||||
|
@ -128,24 +128,24 @@ type Hooks struct {
|
||||||
// Linux contains platform specific configuration for Linux based containers.
|
// Linux contains platform specific configuration for Linux based containers.
|
||||||
type Linux struct {
|
type Linux struct {
|
||||||
// UIDMapping specifies user mappings for supporting user namespaces on Linux.
|
// UIDMapping specifies user mappings for supporting user namespaces on Linux.
|
||||||
UIDMappings []IDMapping `json:"uidMappings,omitempty"`
|
UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"`
|
||||||
// GIDMapping specifies group mappings for supporting user namespaces on Linux.
|
// GIDMapping specifies group mappings for supporting user namespaces on Linux.
|
||||||
GIDMappings []IDMapping `json:"gidMappings,omitempty"`
|
GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"`
|
||||||
// Sysctl are a set of key value pairs that are set for the container on start
|
// Sysctl are a set of key value pairs that are set for the container on start
|
||||||
Sysctl map[string]string `json:"sysctl,omitempty"`
|
Sysctl map[string]string `json:"sysctl,omitempty"`
|
||||||
// Resources contain cgroup information for handling resource constraints
|
// Resources contain cgroup information for handling resource constraints
|
||||||
// for the container
|
// for the container
|
||||||
Resources *Resources `json:"resources,omitempty"`
|
Resources *LinuxResources `json:"resources,omitempty"`
|
||||||
// CgroupsPath specifies the path to cgroups that are created and/or joined by the container.
|
// CgroupsPath specifies the path to cgroups that are created and/or joined by the container.
|
||||||
// The path is expected to be relative to the cgroups mountpoint.
|
// The path is expected to be relative to the cgroups mountpoint.
|
||||||
// If resources are specified, the cgroups at CgroupsPath will be updated based on resources.
|
// If resources are specified, the cgroups at CgroupsPath will be updated based on resources.
|
||||||
CgroupsPath *string `json:"cgroupsPath,omitempty"`
|
CgroupsPath *string `json:"cgroupsPath,omitempty"`
|
||||||
// Namespaces contains the namespaces that are created and/or joined by the container
|
// Namespaces contains the namespaces that are created and/or joined by the container
|
||||||
Namespaces []Namespace `json:"namespaces,omitempty"`
|
Namespaces []LinuxNamespace `json:"namespaces,omitempty"`
|
||||||
// Devices are a list of device nodes that are created for the container
|
// Devices are a list of device nodes that are created for the container
|
||||||
Devices []Device `json:"devices,omitempty"`
|
Devices []LinuxDevice `json:"devices,omitempty"`
|
||||||
// Seccomp specifies the seccomp security settings for the container.
|
// Seccomp specifies the seccomp security settings for the container.
|
||||||
Seccomp *Seccomp `json:"seccomp,omitempty"`
|
Seccomp *LinuxSeccomp `json:"seccomp,omitempty"`
|
||||||
// RootfsPropagation is the rootfs mount propagation mode for the container.
|
// RootfsPropagation is the rootfs mount propagation mode for the container.
|
||||||
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
|
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
|
||||||
// MaskedPaths masks over the provided paths inside the container.
|
// MaskedPaths masks over the provided paths inside the container.
|
||||||
|
@ -156,21 +156,21 @@ type Linux struct {
|
||||||
MountLabel string `json:"mountLabel,omitempty"`
|
MountLabel string `json:"mountLabel,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Namespace is the configuration for a Linux namespace
|
// LinuxNamespace is the configuration for a Linux namespace
|
||||||
type Namespace struct {
|
type LinuxNamespace struct {
|
||||||
// Type is the type of Linux namespace
|
// Type is the type of Linux namespace
|
||||||
Type NamespaceType `json:"type"`
|
Type LinuxNamespaceType `json:"type"`
|
||||||
// Path is a path to an existing namespace persisted on disk that can be joined
|
// Path is a path to an existing namespace persisted on disk that can be joined
|
||||||
// and is of the same type
|
// and is of the same type
|
||||||
Path string `json:"path,omitempty"`
|
Path string `json:"path,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NamespaceType is one of the Linux namespaces
|
// LinuxNamespaceType is one of the Linux namespaces
|
||||||
type NamespaceType string
|
type LinuxNamespaceType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// PIDNamespace for isolating process IDs
|
// PIDNamespace for isolating process IDs
|
||||||
PIDNamespace NamespaceType = "pid"
|
PIDNamespace LinuxNamespaceType = "pid"
|
||||||
// NetworkNamespace for isolating network devices, stacks, ports, etc
|
// NetworkNamespace for isolating network devices, stacks, ports, etc
|
||||||
NetworkNamespace = "network"
|
NetworkNamespace = "network"
|
||||||
// MountNamespace for isolating mount points
|
// MountNamespace for isolating mount points
|
||||||
|
@ -185,18 +185,18 @@ const (
|
||||||
CgroupNamespace = "cgroup"
|
CgroupNamespace = "cgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IDMapping specifies UID/GID mappings
|
// LinuxIDMapping specifies UID/GID mappings
|
||||||
type IDMapping struct {
|
type LinuxIDMapping struct {
|
||||||
// HostID is the UID/GID of the host user or group
|
// HostID is the starting UID/GID on the host to be mapped to 'ContainerID'
|
||||||
HostID uint32 `json:"hostID"`
|
HostID uint32 `json:"hostID"`
|
||||||
// ContainerID is the UID/GID of the container's user or group
|
// ContainerID is the starting UID/GID in the container
|
||||||
ContainerID uint32 `json:"containerID"`
|
ContainerID uint32 `json:"containerID"`
|
||||||
// Size is the length of the range of IDs mapped between the two namespaces
|
// Size is the number of IDs to be mapped
|
||||||
Size uint32 `json:"size"`
|
Size uint32 `json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rlimit type and restrictions
|
// LinuxRlimit type and restrictions
|
||||||
type Rlimit struct {
|
type LinuxRlimit struct {
|
||||||
// Type of the rlimit to set
|
// Type of the rlimit to set
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
// Hard is the hard limit for the specified type
|
// Hard is the hard limit for the specified type
|
||||||
|
@ -205,66 +205,66 @@ type Rlimit struct {
|
||||||
Soft uint64 `json:"soft"`
|
Soft uint64 `json:"soft"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HugepageLimit structure corresponds to limiting kernel hugepages
|
// LinuxHugepageLimit structure corresponds to limiting kernel hugepages
|
||||||
type HugepageLimit struct {
|
type LinuxHugepageLimit struct {
|
||||||
// Pagesize is the hugepage size
|
// Pagesize is the hugepage size
|
||||||
Pagesize *string `json:"pageSize,omitempty"`
|
Pagesize string `json:"pageSize"`
|
||||||
// Limit is the limit of "hugepagesize" hugetlb usage
|
// Limit is the limit of "hugepagesize" hugetlb usage
|
||||||
Limit *uint64 `json:"limit,omitempty"`
|
Limit uint64 `json:"limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InterfacePriority for network interfaces
|
// LinuxInterfacePriority for network interfaces
|
||||||
type InterfacePriority struct {
|
type LinuxInterfacePriority struct {
|
||||||
// Name is the name of the network interface
|
// Name is the name of the network interface
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
// Priority for the interface
|
// Priority for the interface
|
||||||
Priority uint32 `json:"priority"`
|
Priority uint32 `json:"priority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// blockIODevice holds major:minor format supported in blkio cgroup
|
// linuxBlockIODevice holds major:minor format supported in blkio cgroup
|
||||||
type blockIODevice struct {
|
type linuxBlockIODevice struct {
|
||||||
// Major is the device's major number.
|
// Major is the device's major number.
|
||||||
Major int64 `json:"major"`
|
Major int64 `json:"major"`
|
||||||
// Minor is the device's minor number.
|
// Minor is the device's minor number.
|
||||||
Minor int64 `json:"minor"`
|
Minor int64 `json:"minor"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// WeightDevice struct holds a `major:minor weight` pair for blkioWeightDevice
|
// LinuxWeightDevice struct holds a `major:minor weight` pair for blkioWeightDevice
|
||||||
type WeightDevice struct {
|
type LinuxWeightDevice struct {
|
||||||
blockIODevice
|
linuxBlockIODevice
|
||||||
// Weight is the bandwidth rate for the device, range is from 10 to 1000
|
// Weight is the bandwidth rate for the device, range is from 10 to 1000
|
||||||
Weight *uint16 `json:"weight,omitempty"`
|
Weight *uint16 `json:"weight,omitempty"`
|
||||||
// LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, range is from 10 to 1000, CFQ scheduler only
|
// LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, range is from 10 to 1000, CFQ scheduler only
|
||||||
LeafWeight *uint16 `json:"leafWeight,omitempty"`
|
LeafWeight *uint16 `json:"leafWeight,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ThrottleDevice struct holds a `major:minor rate_per_second` pair
|
// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair
|
||||||
type ThrottleDevice struct {
|
type LinuxThrottleDevice struct {
|
||||||
blockIODevice
|
linuxBlockIODevice
|
||||||
// Rate is the IO rate limit per cgroup per device
|
// Rate is the IO rate limit per cgroup per device
|
||||||
Rate *uint64 `json:"rate,omitempty"`
|
Rate uint64 `json:"rate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockIO for Linux cgroup 'blkio' resource management
|
// LinuxBlockIO for Linux cgroup 'blkio' resource management
|
||||||
type BlockIO struct {
|
type LinuxBlockIO struct {
|
||||||
// Specifies per cgroup weight, range is from 10 to 1000
|
// Specifies per cgroup weight, range is from 10 to 1000
|
||||||
Weight *uint16 `json:"blkioWeight,omitempty"`
|
Weight *uint16 `json:"blkioWeight,omitempty"`
|
||||||
// Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, range is from 10 to 1000, CFQ scheduler only
|
// Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, range is from 10 to 1000, CFQ scheduler only
|
||||||
LeafWeight *uint16 `json:"blkioLeafWeight,omitempty"`
|
LeafWeight *uint16 `json:"blkioLeafWeight,omitempty"`
|
||||||
// Weight per cgroup per device, can override BlkioWeight
|
// Weight per cgroup per device, can override BlkioWeight
|
||||||
WeightDevice []WeightDevice `json:"blkioWeightDevice,omitempty"`
|
WeightDevice []LinuxWeightDevice `json:"blkioWeightDevice,omitempty"`
|
||||||
// IO read rate limit per cgroup per device, bytes per second
|
// IO read rate limit per cgroup per device, bytes per second
|
||||||
ThrottleReadBpsDevice []ThrottleDevice `json:"blkioThrottleReadBpsDevice,omitempty"`
|
ThrottleReadBpsDevice []LinuxThrottleDevice `json:"blkioThrottleReadBpsDevice,omitempty"`
|
||||||
// IO write rate limit per cgroup per device, bytes per second
|
// IO write rate limit per cgroup per device, bytes per second
|
||||||
ThrottleWriteBpsDevice []ThrottleDevice `json:"blkioThrottleWriteBpsDevice,omitempty"`
|
ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"blkioThrottleWriteBpsDevice,omitempty"`
|
||||||
// IO read rate limit per cgroup per device, IO per second
|
// IO read rate limit per cgroup per device, IO per second
|
||||||
ThrottleReadIOPSDevice []ThrottleDevice `json:"blkioThrottleReadIOPSDevice,omitempty"`
|
ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"blkioThrottleReadIOPSDevice,omitempty"`
|
||||||
// IO write rate limit per cgroup per device, IO per second
|
// IO write rate limit per cgroup per device, IO per second
|
||||||
ThrottleWriteIOPSDevice []ThrottleDevice `json:"blkioThrottleWriteIOPSDevice,omitempty"`
|
ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"blkioThrottleWriteIOPSDevice,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Memory for Linux cgroup 'memory' resource management
|
// LinuxMemory for Linux cgroup 'memory' resource management
|
||||||
type Memory struct {
|
type LinuxMemory struct {
|
||||||
// Memory limit (in bytes).
|
// Memory limit (in bytes).
|
||||||
Limit *uint64 `json:"limit,omitempty"`
|
Limit *uint64 `json:"limit,omitempty"`
|
||||||
// Memory reservation or soft_limit (in bytes).
|
// Memory reservation or soft_limit (in bytes).
|
||||||
|
@ -279,8 +279,8 @@ type Memory struct {
|
||||||
Swappiness *uint64 `json:"swappiness,omitempty"`
|
Swappiness *uint64 `json:"swappiness,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CPU for Linux cgroup 'cpu' resource management
|
// LinuxCPU for Linux cgroup 'cpu' resource management
|
||||||
type CPU struct {
|
type LinuxCPU struct {
|
||||||
// CPU shares (relative weight (ratio) vs. other cgroups with cpu shares).
|
// CPU shares (relative weight (ratio) vs. other cgroups with cpu shares).
|
||||||
Shares *uint64 `json:"shares,omitempty"`
|
Shares *uint64 `json:"shares,omitempty"`
|
||||||
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
|
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
|
||||||
|
@ -297,44 +297,44 @@ type CPU struct {
|
||||||
Mems *string `json:"mems,omitempty"`
|
Mems *string `json:"mems,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pids for Linux cgroup 'pids' resource management (Linux 4.3)
|
// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3)
|
||||||
type Pids struct {
|
type LinuxPids struct {
|
||||||
// Maximum number of PIDs. Default is "no limit".
|
// Maximum number of PIDs. Default is "no limit".
|
||||||
Limit *int64 `json:"limit,omitempty"`
|
Limit int64 `json:"limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network identification and priority configuration
|
// LinuxNetwork identification and priority configuration
|
||||||
type Network struct {
|
type LinuxNetwork struct {
|
||||||
// Set class identifier for container's network packets
|
// Set class identifier for container's network packets
|
||||||
ClassID *uint32 `json:"classID,omitempty"`
|
ClassID *uint32 `json:"classID,omitempty"`
|
||||||
// Set priority of network traffic for container
|
// Set priority of network traffic for container
|
||||||
Priorities []InterfacePriority `json:"priorities,omitempty"`
|
Priorities []LinuxInterfacePriority `json:"priorities,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resources has container runtime resource constraints
|
// LinuxResources has container runtime resource constraints
|
||||||
type Resources struct {
|
type LinuxResources struct {
|
||||||
// Devices configures the device whitelist.
|
// Devices configures the device whitelist.
|
||||||
Devices []DeviceCgroup `json:"devices,omitempty"`
|
Devices []LinuxDeviceCgroup `json:"devices,omitempty"`
|
||||||
// DisableOOMKiller disables the OOM killer for out of memory conditions
|
// DisableOOMKiller disables the OOM killer for out of memory conditions
|
||||||
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
|
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
|
||||||
// Specify an oom_score_adj for the container.
|
// Specify an oom_score_adj for the container.
|
||||||
OOMScoreAdj *int `json:"oomScoreAdj,omitempty"`
|
OOMScoreAdj *int `json:"oomScoreAdj,omitempty"`
|
||||||
// Memory restriction configuration
|
// Memory restriction configuration
|
||||||
Memory *Memory `json:"memory,omitempty"`
|
Memory *LinuxMemory `json:"memory,omitempty"`
|
||||||
// CPU resource restriction configuration
|
// CPU resource restriction configuration
|
||||||
CPU *CPU `json:"cpu,omitempty"`
|
CPU *LinuxCPU `json:"cpu,omitempty"`
|
||||||
// Task resource restriction configuration.
|
// Task resource restriction configuration.
|
||||||
Pids *Pids `json:"pids,omitempty"`
|
Pids *LinuxPids `json:"pids,omitempty"`
|
||||||
// BlockIO restriction configuration
|
// BlockIO restriction configuration
|
||||||
BlockIO *BlockIO `json:"blockIO,omitempty"`
|
BlockIO *LinuxBlockIO `json:"blockIO,omitempty"`
|
||||||
// Hugetlb limit (in bytes)
|
// Hugetlb limit (in bytes)
|
||||||
HugepageLimits []HugepageLimit `json:"hugepageLimits,omitempty"`
|
HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"`
|
||||||
// Network restriction configuration
|
// Network restriction configuration
|
||||||
Network *Network `json:"network,omitempty"`
|
Network *LinuxNetwork `json:"network,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Device represents the mknod information for a Linux special device file
|
// LinuxDevice represents the mknod information for a Linux special device file
|
||||||
type Device struct {
|
type LinuxDevice struct {
|
||||||
// Path to the device.
|
// Path to the device.
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
// Device type, block, char, etc.
|
// Device type, block, char, etc.
|
||||||
|
@ -351,8 +351,8 @@ type Device struct {
|
||||||
GID *uint32 `json:"gid,omitempty"`
|
GID *uint32 `json:"gid,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeviceCgroup represents a device rule for the whitelist controller
|
// LinuxDeviceCgroup represents a device rule for the whitelist controller
|
||||||
type DeviceCgroup struct {
|
type LinuxDeviceCgroup struct {
|
||||||
// Allow or deny
|
// Allow or deny
|
||||||
Allow bool `json:"allow"`
|
Allow bool `json:"allow"`
|
||||||
// Device type, block, char, etc.
|
// Device type, block, char, etc.
|
||||||
|
@ -365,11 +365,11 @@ type DeviceCgroup struct {
|
||||||
Access *string `json:"access,omitempty"`
|
Access *string `json:"access,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seccomp represents syscall restrictions
|
// LinuxSeccomp represents syscall restrictions
|
||||||
type Seccomp struct {
|
type LinuxSeccomp struct {
|
||||||
DefaultAction Action `json:"defaultAction"`
|
DefaultAction LinuxSeccompAction `json:"defaultAction"`
|
||||||
Architectures []Arch `json:"architectures"`
|
Architectures []Arch `json:"architectures"`
|
||||||
Syscalls []Syscall `json:"syscalls,omitempty"`
|
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solaris contains platform specific configuration for Solaris application containers.
|
// Solaris contains platform specific configuration for Solaris application containers.
|
||||||
|
@ -381,26 +381,26 @@ type Solaris struct {
|
||||||
// The maximum amount of shared memory allowed for this container.
|
// The maximum amount of shared memory allowed for this container.
|
||||||
MaxShmMemory string `json:"maxShmMemory,omitempty"`
|
MaxShmMemory string `json:"maxShmMemory,omitempty"`
|
||||||
// Specification for automatic creation of network resources for this container.
|
// Specification for automatic creation of network resources for this container.
|
||||||
Anet []Anet `json:"anet,omitempty"`
|
Anet []SolarisAnet `json:"anet,omitempty"`
|
||||||
// Set limit on the amount of CPU time that can be used by container.
|
// Set limit on the amount of CPU time that can be used by container.
|
||||||
CappedCPU *CappedCPU `json:"cappedCPU,omitempty"`
|
CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"`
|
||||||
// The physical and swap caps on the memory that can be used by this container.
|
// The physical and swap caps on the memory that can be used by this container.
|
||||||
CappedMemory *CappedMemory `json:"cappedMemory,omitempty"`
|
CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CappedCPU allows users to set limit on the amount of CPU time that can be used by container.
|
// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container.
|
||||||
type CappedCPU struct {
|
type SolarisCappedCPU struct {
|
||||||
Ncpus string `json:"ncpus,omitempty"`
|
Ncpus string `json:"ncpus,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CappedMemory allows users to set the physical and swap caps on the memory that can be used by this container.
|
// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container.
|
||||||
type CappedMemory struct {
|
type SolarisCappedMemory struct {
|
||||||
Physical string `json:"physical,omitempty"`
|
Physical string `json:"physical,omitempty"`
|
||||||
Swap string `json:"swap,omitempty"`
|
Swap string `json:"swap,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anet provides the specification for automatic creation of network resources for this container.
|
// SolarisAnet provides the specification for automatic creation of network resources for this container.
|
||||||
type Anet struct {
|
type SolarisAnet struct {
|
||||||
// Specify a name for the automatically created VNIC datalink.
|
// Specify a name for the automatically created VNIC datalink.
|
||||||
Linkname string `json:"linkname,omitempty"`
|
Linkname string `json:"linkname,omitempty"`
|
||||||
// Specify the link over which the VNIC will be created.
|
// Specify the link over which the VNIC will be created.
|
||||||
|
@ -493,43 +493,43 @@ const (
|
||||||
ArchS390X Arch = "SCMP_ARCH_S390X"
|
ArchS390X Arch = "SCMP_ARCH_S390X"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Action taken upon Seccomp rule match
|
// LinuxSeccompAction taken upon Seccomp rule match
|
||||||
type Action string
|
type LinuxSeccompAction string
|
||||||
|
|
||||||
// Define actions for Seccomp rules
|
// Define actions for Seccomp rules
|
||||||
const (
|
const (
|
||||||
ActKill Action = "SCMP_ACT_KILL"
|
ActKill LinuxSeccompAction = "SCMP_ACT_KILL"
|
||||||
ActTrap Action = "SCMP_ACT_TRAP"
|
ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP"
|
||||||
ActErrno Action = "SCMP_ACT_ERRNO"
|
ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO"
|
||||||
ActTrace Action = "SCMP_ACT_TRACE"
|
ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE"
|
||||||
ActAllow Action = "SCMP_ACT_ALLOW"
|
ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Operator used to match syscall arguments in Seccomp
|
// LinuxSeccompOperator used to match syscall arguments in Seccomp
|
||||||
type Operator string
|
type LinuxSeccompOperator string
|
||||||
|
|
||||||
// Define operators for syscall arguments in Seccomp
|
// Define operators for syscall arguments in Seccomp
|
||||||
const (
|
const (
|
||||||
OpNotEqual Operator = "SCMP_CMP_NE"
|
OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE"
|
||||||
OpLessThan Operator = "SCMP_CMP_LT"
|
OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT"
|
||||||
OpLessEqual Operator = "SCMP_CMP_LE"
|
OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE"
|
||||||
OpEqualTo Operator = "SCMP_CMP_EQ"
|
OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ"
|
||||||
OpGreaterEqual Operator = "SCMP_CMP_GE"
|
OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE"
|
||||||
OpGreaterThan Operator = "SCMP_CMP_GT"
|
OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT"
|
||||||
OpMaskedEqual Operator = "SCMP_CMP_MASKED_EQ"
|
OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Arg used for matching specific syscall arguments in Seccomp
|
// LinuxSeccompArg used for matching specific syscall arguments in Seccomp
|
||||||
type Arg struct {
|
type LinuxSeccompArg struct {
|
||||||
Index uint `json:"index"`
|
Index uint `json:"index"`
|
||||||
Value uint64 `json:"value"`
|
Value uint64 `json:"value"`
|
||||||
ValueTwo uint64 `json:"valueTwo"`
|
ValueTwo uint64 `json:"valueTwo"`
|
||||||
Op Operator `json:"op"`
|
Op LinuxSeccompOperator `json:"op"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Syscall is used to match a syscall in Seccomp
|
// LinuxSyscall is used to match a syscall in Seccomp
|
||||||
type Syscall struct {
|
type LinuxSyscall struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Action Action `json:"action"`
|
Action LinuxSeccompAction `json:"action"`
|
||||||
Args []Arg `json:"args,omitempty"`
|
Args []LinuxSeccompArg `json:"args,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package specs
|
||||||
// State holds information about the runtime state of the container.
|
// State holds information about the runtime state of the container.
|
||||||
type State struct {
|
type State struct {
|
||||||
// Version is the version of the specification that is supported.
|
// Version is the version of the specification that is supported.
|
||||||
Version string `json:"version"`
|
Version string `json:"ociVersion"`
|
||||||
// ID is the container ID
|
// ID is the container ID
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
// Status is the runtime state of the container.
|
// Status is the runtime state of the container.
|
||||||
|
|
2
Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/version.go
generated
vendored
2
Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/version.go
generated
vendored
|
@ -11,7 +11,7 @@ const (
|
||||||
VersionPatch = 0
|
VersionPatch = 0
|
||||||
|
|
||||||
// VersionDev indicates development branch. Releases will be empty string.
|
// VersionDev indicates development branch. Releases will be empty string.
|
||||||
VersionDev = "-rc2-dev"
|
VersionDev = "-rc3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the specification version that the package types support.
|
// Version is the specification version that the package types support.
|
||||||
|
|
|
@ -102,7 +102,7 @@ func setManageCgroupsMode(context *cli.Context, options *libcontainer.CriuOpts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var namespaceMapping = map[specs.NamespaceType]int{
|
var namespaceMapping = map[specs.LinuxNamespaceType]int{
|
||||||
specs.NetworkNamespace: syscall.CLONE_NEWNET,
|
specs.NetworkNamespace: syscall.CLONE_NEWNET,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ func setEmptyNsMask(context *cli.Context, options *libcontainer.CriuOpts) error
|
||||||
var nsmask int
|
var nsmask int
|
||||||
|
|
||||||
for _, ns := range context.StringSlice("empty-ns") {
|
for _, ns := range context.StringSlice("empty-ns") {
|
||||||
f, exists := namespaceMapping[specs.NamespaceType(ns)]
|
f, exists := namespaceMapping[specs.LinuxNamespaceType(ns)]
|
||||||
if !exists {
|
if !exists {
|
||||||
return fmt.Errorf("namespace %q is not supported", ns)
|
return fmt.Errorf("namespace %q is not supported", ns)
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
|
|
||||||
const wildcard = -1
|
const wildcard = -1
|
||||||
|
|
||||||
var namespaceMapping = map[specs.NamespaceType]configs.NamespaceType{
|
var namespaceMapping = map[specs.LinuxNamespaceType]configs.NamespaceType{
|
||||||
specs.PIDNamespace: configs.NEWPID,
|
specs.PIDNamespace: configs.NEWPID,
|
||||||
specs.NetworkNamespace: configs.NEWNET,
|
specs.NetworkNamespace: configs.NEWNET,
|
||||||
specs.MountNamespace: configs.NEWNS,
|
specs.MountNamespace: configs.NEWNS,
|
||||||
|
@ -377,8 +377,8 @@ func createCgroupConfig(name string, useSystemdCgroup bool, spec *specs.Spec) (*
|
||||||
c.Resources.CpusetMems = *r.CPU.Mems
|
c.Resources.CpusetMems = *r.CPU.Mems
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Pids != nil && r.Pids.Limit != nil {
|
if r.Pids != nil {
|
||||||
c.Resources.PidsLimit = *r.Pids.Limit
|
c.Resources.PidsLimit = r.Pids.Limit
|
||||||
}
|
}
|
||||||
if r.BlockIO != nil {
|
if r.BlockIO != nil {
|
||||||
if r.BlockIO.Weight != nil {
|
if r.BlockIO.Weight != nil {
|
||||||
|
@ -402,52 +402,37 @@ func createCgroupConfig(name string, useSystemdCgroup bool, spec *specs.Spec) (*
|
||||||
}
|
}
|
||||||
if r.BlockIO.ThrottleReadBpsDevice != nil {
|
if r.BlockIO.ThrottleReadBpsDevice != nil {
|
||||||
for _, td := range r.BlockIO.ThrottleReadBpsDevice {
|
for _, td := range r.BlockIO.ThrottleReadBpsDevice {
|
||||||
var rate uint64
|
rate := td.Rate
|
||||||
if td.Rate != nil {
|
|
||||||
rate = *td.Rate
|
|
||||||
}
|
|
||||||
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
||||||
c.Resources.BlkioThrottleReadBpsDevice = append(c.Resources.BlkioThrottleReadBpsDevice, throttleDevice)
|
c.Resources.BlkioThrottleReadBpsDevice = append(c.Resources.BlkioThrottleReadBpsDevice, throttleDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.BlockIO.ThrottleWriteBpsDevice != nil {
|
if r.BlockIO.ThrottleWriteBpsDevice != nil {
|
||||||
for _, td := range r.BlockIO.ThrottleWriteBpsDevice {
|
for _, td := range r.BlockIO.ThrottleWriteBpsDevice {
|
||||||
var rate uint64
|
rate := td.Rate
|
||||||
if td.Rate != nil {
|
|
||||||
rate = *td.Rate
|
|
||||||
}
|
|
||||||
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
||||||
c.Resources.BlkioThrottleWriteBpsDevice = append(c.Resources.BlkioThrottleWriteBpsDevice, throttleDevice)
|
c.Resources.BlkioThrottleWriteBpsDevice = append(c.Resources.BlkioThrottleWriteBpsDevice, throttleDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.BlockIO.ThrottleReadIOPSDevice != nil {
|
if r.BlockIO.ThrottleReadIOPSDevice != nil {
|
||||||
for _, td := range r.BlockIO.ThrottleReadIOPSDevice {
|
for _, td := range r.BlockIO.ThrottleReadIOPSDevice {
|
||||||
var rate uint64
|
rate := td.Rate
|
||||||
if td.Rate != nil {
|
|
||||||
rate = *td.Rate
|
|
||||||
}
|
|
||||||
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
||||||
c.Resources.BlkioThrottleReadIOPSDevice = append(c.Resources.BlkioThrottleReadIOPSDevice, throttleDevice)
|
c.Resources.BlkioThrottleReadIOPSDevice = append(c.Resources.BlkioThrottleReadIOPSDevice, throttleDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.BlockIO.ThrottleWriteIOPSDevice != nil {
|
if r.BlockIO.ThrottleWriteIOPSDevice != nil {
|
||||||
for _, td := range r.BlockIO.ThrottleWriteIOPSDevice {
|
for _, td := range r.BlockIO.ThrottleWriteIOPSDevice {
|
||||||
var rate uint64
|
rate := td.Rate
|
||||||
if td.Rate != nil {
|
|
||||||
rate = *td.Rate
|
|
||||||
}
|
|
||||||
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
throttleDevice := configs.NewThrottleDevice(td.Major, td.Minor, rate)
|
||||||
c.Resources.BlkioThrottleWriteIOPSDevice = append(c.Resources.BlkioThrottleWriteIOPSDevice, throttleDevice)
|
c.Resources.BlkioThrottleWriteIOPSDevice = append(c.Resources.BlkioThrottleWriteIOPSDevice, throttleDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, l := range r.HugepageLimits {
|
for _, l := range r.HugepageLimits {
|
||||||
if l.Pagesize == nil || l.Limit == nil {
|
|
||||||
return nil, fmt.Errorf("pagesize and limit can not be empty")
|
|
||||||
}
|
|
||||||
c.Resources.HugetlbLimit = append(c.Resources.HugetlbLimit, &configs.HugepageLimit{
|
c.Resources.HugetlbLimit = append(c.Resources.HugetlbLimit, &configs.HugepageLimit{
|
||||||
Pagesize: *l.Pagesize,
|
Pagesize: l.Pagesize,
|
||||||
Limit: *l.Limit,
|
Limit: l.Limit,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if r.DisableOOMKiller != nil {
|
if r.DisableOOMKiller != nil {
|
||||||
|
@ -574,7 +559,7 @@ func setupUserNamespace(spec *specs.Spec, config *configs.Config) error {
|
||||||
if len(spec.Linux.UIDMappings) == 0 {
|
if len(spec.Linux.UIDMappings) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
create := func(m specs.IDMapping) configs.IDMap {
|
create := func(m specs.LinuxIDMapping) configs.IDMap {
|
||||||
return configs.IDMap{
|
return configs.IDMap{
|
||||||
HostID: int(m.HostID),
|
HostID: int(m.HostID),
|
||||||
ContainerID: int(m.ContainerID),
|
ContainerID: int(m.ContainerID),
|
||||||
|
@ -682,7 +667,7 @@ func parseMountOptions(options []string) (int, []int, string, int) {
|
||||||
return flag, pgflag, strings.Join(data, ","), extFlags
|
return flag, pgflag, strings.Join(data, ","), extFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupSeccomp(config *specs.Seccomp) (*configs.Seccomp, error) {
|
func setupSeccomp(config *specs.LinuxSeccomp) (*configs.Seccomp, error) {
|
||||||
if config == nil {
|
if config == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ func TestLinuxCgroupsPathNotSpecified(t *testing.T) {
|
||||||
func TestDupNamespaces(t *testing.T) {
|
func TestDupNamespaces(t *testing.T) {
|
||||||
spec := &specs.Spec{
|
spec := &specs.Spec{
|
||||||
Linux: &specs.Linux{
|
Linux: &specs.Linux{
|
||||||
Namespaces: []specs.Namespace{
|
Namespaces: []specs.LinuxNamespace{
|
||||||
{
|
{
|
||||||
Type: "pid",
|
Type: "pid",
|
||||||
},
|
},
|
||||||
|
|
10
spec.go
10
spec.go
|
@ -92,7 +92,7 @@ container on your host.`,
|
||||||
"CAP_KILL",
|
"CAP_KILL",
|
||||||
"CAP_NET_BIND_SERVICE",
|
"CAP_NET_BIND_SERVICE",
|
||||||
},
|
},
|
||||||
Rlimits: []specs.Rlimit{
|
Rlimits: []specs.LinuxRlimit{
|
||||||
{
|
{
|
||||||
Type: "RLIMIT_NOFILE",
|
Type: "RLIMIT_NOFILE",
|
||||||
Hard: uint64(1024),
|
Hard: uint64(1024),
|
||||||
|
@ -162,15 +162,15 @@ container on your host.`,
|
||||||
"/proc/sys",
|
"/proc/sys",
|
||||||
"/proc/sysrq-trigger",
|
"/proc/sysrq-trigger",
|
||||||
},
|
},
|
||||||
Resources: &specs.Resources{
|
Resources: &specs.LinuxResources{
|
||||||
Devices: []specs.DeviceCgroup{
|
Devices: []specs.LinuxDeviceCgroup{
|
||||||
{
|
{
|
||||||
Allow: false,
|
Allow: false,
|
||||||
Access: sPtr("rwm"),
|
Access: sPtr("rwm"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Namespaces: []specs.Namespace{
|
Namespaces: []specs.LinuxNamespace{
|
||||||
{
|
{
|
||||||
Type: "pid",
|
Type: "pid",
|
||||||
},
|
},
|
||||||
|
@ -246,7 +246,7 @@ func loadSpec(cPath string) (spec *specs.Spec, err error) {
|
||||||
return spec, validateProcessSpec(&spec.Process)
|
return spec, validateProcessSpec(&spec.Process)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createLibContainerRlimit(rlimit specs.Rlimit) (configs.Rlimit, error) {
|
func createLibContainerRlimit(rlimit specs.LinuxRlimit) (configs.Rlimit, error) {
|
||||||
rl, err := strToRlimit(rlimit.Type)
|
rl, err := strToRlimit(rlimit.Type)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return configs.Rlimit{}, err
|
return configs.Rlimit{}, err
|
||||||
|
|
|
@ -114,15 +114,15 @@ other options are ignored.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r := specs.Resources{
|
r := specs.LinuxResources{
|
||||||
Memory: &specs.Memory{
|
Memory: &specs.LinuxMemory{
|
||||||
Limit: u64Ptr(0),
|
Limit: u64Ptr(0),
|
||||||
Reservation: u64Ptr(0),
|
Reservation: u64Ptr(0),
|
||||||
Swap: u64Ptr(0),
|
Swap: u64Ptr(0),
|
||||||
Kernel: u64Ptr(0),
|
Kernel: u64Ptr(0),
|
||||||
KernelTCP: u64Ptr(0),
|
KernelTCP: u64Ptr(0),
|
||||||
},
|
},
|
||||||
CPU: &specs.CPU{
|
CPU: &specs.LinuxCPU{
|
||||||
Shares: u64Ptr(0),
|
Shares: u64Ptr(0),
|
||||||
Quota: u64Ptr(0),
|
Quota: u64Ptr(0),
|
||||||
Period: u64Ptr(0),
|
Period: u64Ptr(0),
|
||||||
|
@ -131,7 +131,7 @@ other options are ignored.
|
||||||
Cpus: sPtr(""),
|
Cpus: sPtr(""),
|
||||||
Mems: sPtr(""),
|
Mems: sPtr(""),
|
||||||
},
|
},
|
||||||
BlockIO: &specs.BlockIO{
|
BlockIO: &specs.LinuxBlockIO{
|
||||||
Weight: u16Ptr(0),
|
Weight: u16Ptr(0),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue