Merge pull request #923 from madhanrm/vendorcd

Vendor in runtime-spec & runtime-tools from github.com/opencontainers
This commit is contained in:
Lantao Liu 2018-09-24 00:31:03 -07:00 committed by GitHub
commit 733f7199b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 13 deletions

View File

@ -41,8 +41,8 @@ github.com/modern-go/reflect2 1.0.1
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7 github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd
github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce github.com/opencontainers/runtime-spec eba862dc2470385a233c7507392675cbeadf7353
github.com/opencontainers/runtime-tools v0.6.0 github.com/opencontainers/runtime-tools fb101d5d42ab9c040f7d0a004e78336e5d5cb197
github.com/opencontainers/selinux b6fa367ed7f534f9ba25391cc2d467085dbb445a github.com/opencontainers/selinux b6fa367ed7f534f9ba25391cc2d467085dbb445a
github.com/pkg/errors v0.8.0 github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib v1.0.0

View File

@ -503,6 +503,8 @@ type WindowsNetwork struct {
DNSSearchList []string `json:"DNSSearchList,omitempty"` DNSSearchList []string `json:"DNSSearchList,omitempty"`
// Name (ID) of the container that we will share with the network stack. // Name (ID) of the container that we will share with the network stack.
NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"`
// name (ID) of the network namespace that will be used for the container.
NetworkNamespace string `json:"networkNamespace,omitempty"`
} }
// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. // WindowsHyperV contains information for configuring a container to run with Hyper-V isolation.

View File

@ -43,9 +43,9 @@ Build the validation executables:
$ make runtimetest validation-executables $ make runtimetest validation-executables
``` ```
Runtime validation currently [only supports](docs/runtime-compliance-testing.md) the [OCI Runtime Command Line Interface](doc/command-line-interface.md). Runtime validation currently [only supports](docs/runtime-compliance-testing.md) the [OCI Runtime Command Line Interface](docs/command-line-interface.md).
If we add support for alternative APIs in the future, runtime validation will gain an option to select the desired runtime API. If we add support for alternative APIs in the future, runtime validation will gain an option to select the desired runtime API.
For the command line interface, the `RUNTIME` option selects the runtime command (`funC` in the [OCI Runtime Command Line Interface](doc/command-line-interface.md)). For the command line interface, the `RUNTIME` option selects the runtime command (`funC` in the [OCI Runtime Command Line Interface](docs/command-line-interface.md)).
``` ```
$ sudo make RUNTIME=runc localvalidation $ sudo make RUNTIME=runc localvalidation
@ -69,7 +69,7 @@ validation/linux_cgroups_hugetlb.t .................... 0/1
validation/linux_cgroups_memory.t ..................... 9/9 validation/linux_cgroups_memory.t ..................... 9/9
validation/linux_rootfs_propagation_shared.t ...... 252/282 validation/linux_rootfs_propagation_shared.t ...... 252/282
not ok shared root propogation exposes "/target348456609/mount892511628/example376408222" not ok shared root propagation exposes "/target348456609/mount892511628/example376408222"
Skipped: 29 Skipped: 29
/dev/null (default device) has unconfigured permissions /dev/null (default device) has unconfigured permissions

View File

@ -94,7 +94,8 @@ func (g *Generator) initConfigLinuxResourcesBlockIO() {
} }
} }
func (g *Generator) initConfigLinuxResourcesCPU() { // InitConfigLinuxResourcesCPU initializes CPU of Linux resources
func (g *Generator) InitConfigLinuxResourcesCPU() {
g.initConfigLinuxResources() g.initConfigLinuxResources()
if g.Config.Linux.Resources.CPU == nil { if g.Config.Linux.Resources.CPU == nil {
g.Config.Linux.Resources.CPU = &rspec.LinuxCPU{} g.Config.Linux.Resources.CPU = &rspec.LinuxCPU{}

View File

@ -703,43 +703,43 @@ func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64
// SetLinuxResourcesCPUShares sets g.Config.Linux.Resources.CPU.Shares. // SetLinuxResourcesCPUShares sets g.Config.Linux.Resources.CPU.Shares.
func (g *Generator) SetLinuxResourcesCPUShares(shares uint64) { func (g *Generator) SetLinuxResourcesCPUShares(shares uint64) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Shares = &shares g.Config.Linux.Resources.CPU.Shares = &shares
} }
// SetLinuxResourcesCPUQuota sets g.Config.Linux.Resources.CPU.Quota. // SetLinuxResourcesCPUQuota sets g.Config.Linux.Resources.CPU.Quota.
func (g *Generator) SetLinuxResourcesCPUQuota(quota int64) { func (g *Generator) SetLinuxResourcesCPUQuota(quota int64) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Quota = &quota g.Config.Linux.Resources.CPU.Quota = &quota
} }
// SetLinuxResourcesCPUPeriod sets g.Config.Linux.Resources.CPU.Period. // SetLinuxResourcesCPUPeriod sets g.Config.Linux.Resources.CPU.Period.
func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64) { func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Period = &period g.Config.Linux.Resources.CPU.Period = &period
} }
// SetLinuxResourcesCPURealtimeRuntime sets g.Config.Linux.Resources.CPU.RealtimeRuntime. // SetLinuxResourcesCPURealtimeRuntime sets g.Config.Linux.Resources.CPU.RealtimeRuntime.
func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64) { func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimeRuntime = &time g.Config.Linux.Resources.CPU.RealtimeRuntime = &time
} }
// SetLinuxResourcesCPURealtimePeriod sets g.Config.Linux.Resources.CPU.RealtimePeriod. // SetLinuxResourcesCPURealtimePeriod sets g.Config.Linux.Resources.CPU.RealtimePeriod.
func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64) { func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.RealtimePeriod = &period g.Config.Linux.Resources.CPU.RealtimePeriod = &period
} }
// SetLinuxResourcesCPUCpus sets g.Config.Linux.Resources.CPU.Cpus. // SetLinuxResourcesCPUCpus sets g.Config.Linux.Resources.CPU.Cpus.
func (g *Generator) SetLinuxResourcesCPUCpus(cpus string) { func (g *Generator) SetLinuxResourcesCPUCpus(cpus string) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Cpus = cpus g.Config.Linux.Resources.CPU.Cpus = cpus
} }
// SetLinuxResourcesCPUMems sets g.Config.Linux.Resources.CPU.Mems. // SetLinuxResourcesCPUMems sets g.Config.Linux.Resources.CPU.Mems.
func (g *Generator) SetLinuxResourcesCPUMems(mems string) { func (g *Generator) SetLinuxResourcesCPUMems(mems string) {
g.initConfigLinuxResourcesCPU() g.InitConfigLinuxResourcesCPU()
g.Config.Linux.Resources.CPU.Mems = mems g.Config.Linux.Resources.CPU.Mems = mems
} }
@ -1537,6 +1537,12 @@ func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork) {
g.Config.Windows.Network = &network g.Config.Windows.Network = &network
} }
// SetWindowsNetworkNamespace sets g.Config.Windows.Network.NetworkNamespace
func (g *Generator) SetWindowsNetworkNamespace(path string) {
g.initConfigWindows()
g.Config.Windows.Network.NetworkNamespace = path
}
// SetWindowsResourcesCPU sets g.Config.Windows.Resources.CPU. // SetWindowsResourcesCPU sets g.Config.Windows.Resources.CPU.
func (g *Generator) SetWindowsResourcesCPU(cpu rspec.WindowsCPUResources) { func (g *Generator) SetWindowsResourcesCPU(cpu rspec.WindowsCPUResources) {
g.initConfigWindowsResources() g.initConfigWindowsResources()