From 5d777b2e3527b06038316e82a2c1a5cefea05851 Mon Sep 17 00:00:00 2001 From: Madhan Raj Mookkandy Date: Fri, 21 Sep 2018 14:42:34 -0700 Subject: [PATCH] Vendor in runtime-spec & runtime-tools from github.com/opencontainers Signed-off-by: Madhan Raj Mookkandy --- vendor.conf | 4 ++-- .../runtime-spec/specs-go/config.go | 2 ++ .../opencontainers/runtime-tools/README.md | 6 +++--- .../runtime-tools/generate/config.go | 3 ++- .../runtime-tools/generate/generate.go | 20 ++++++++++++------- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/vendor.conf b/vendor.conf index a9ffca873..269b8c3c3 100644 --- a/vendor.conf +++ b/vendor.conf @@ -41,8 +41,8 @@ github.com/modern-go/reflect2 1.0.1 github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7 github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd -github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce -github.com/opencontainers/runtime-tools v0.6.0 +github.com/opencontainers/runtime-spec eba862dc2470385a233c7507392675cbeadf7353 +github.com/opencontainers/runtime-tools fb101d5d42ab9c040f7d0a004e78336e5d5cb197 github.com/opencontainers/selinux b6fa367ed7f534f9ba25391cc2d467085dbb445a github.com/pkg/errors v0.8.0 github.com/pmezard/go-difflib v1.0.0 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 7781c5361..f32698cab 100644 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -503,6 +503,8 @@ type WindowsNetwork struct { DNSSearchList []string `json:"DNSSearchList,omitempty"` // Name (ID) of the container that we will share with the network stack. 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. diff --git a/vendor/github.com/opencontainers/runtime-tools/README.md b/vendor/github.com/opencontainers/runtime-tools/README.md index 19d0e4a26..11f613cf9 100644 --- a/vendor/github.com/opencontainers/runtime-tools/README.md +++ b/vendor/github.com/opencontainers/runtime-tools/README.md @@ -43,9 +43,9 @@ Build the 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. -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 @@ -69,7 +69,7 @@ validation/linux_cgroups_hugetlb.t .................... 0/1 validation/linux_cgroups_memory.t ..................... 9/9 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 /dev/null (default device) has unconfigured permissions diff --git a/vendor/github.com/opencontainers/runtime-tools/generate/config.go b/vendor/github.com/opencontainers/runtime-tools/generate/config.go index 9421b6d8f..164fdf141 100644 --- a/vendor/github.com/opencontainers/runtime-tools/generate/config.go +++ b/vendor/github.com/opencontainers/runtime-tools/generate/config.go @@ -94,7 +94,8 @@ func (g *Generator) initConfigLinuxResourcesBlockIO() { } } -func (g *Generator) initConfigLinuxResourcesCPU() { +// InitConfigLinuxResourcesCPU initializes CPU of Linux resources +func (g *Generator) InitConfigLinuxResourcesCPU() { g.initConfigLinuxResources() if g.Config.Linux.Resources.CPU == nil { g.Config.Linux.Resources.CPU = &rspec.LinuxCPU{} diff --git a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go index 07b57b44b..5376372c4 100644 --- a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go +++ b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go @@ -703,43 +703,43 @@ func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64 // SetLinuxResourcesCPUShares sets g.Config.Linux.Resources.CPU.Shares. func (g *Generator) SetLinuxResourcesCPUShares(shares uint64) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.Shares = &shares } // SetLinuxResourcesCPUQuota sets g.Config.Linux.Resources.CPU.Quota. func (g *Generator) SetLinuxResourcesCPUQuota(quota int64) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.Quota = "a } // SetLinuxResourcesCPUPeriod sets g.Config.Linux.Resources.CPU.Period. func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.Period = &period } // SetLinuxResourcesCPURealtimeRuntime sets g.Config.Linux.Resources.CPU.RealtimeRuntime. func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.RealtimeRuntime = &time } // SetLinuxResourcesCPURealtimePeriod sets g.Config.Linux.Resources.CPU.RealtimePeriod. func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.RealtimePeriod = &period } // SetLinuxResourcesCPUCpus sets g.Config.Linux.Resources.CPU.Cpus. func (g *Generator) SetLinuxResourcesCPUCpus(cpus string) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.Cpus = cpus } // SetLinuxResourcesCPUMems sets g.Config.Linux.Resources.CPU.Mems. func (g *Generator) SetLinuxResourcesCPUMems(mems string) { - g.initConfigLinuxResourcesCPU() + g.InitConfigLinuxResourcesCPU() g.Config.Linux.Resources.CPU.Mems = mems } @@ -1537,6 +1537,12 @@ func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork) { 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. func (g *Generator) SetWindowsResourcesCPU(cpu rspec.WindowsCPUResources) { g.initConfigWindowsResources()