Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ RUN mkdir -p /usr/src/criu \
&& rm -rf /usr/src/criu

# Install runc
# TODO: This should actually be v1.0.0-rc3 but we first need to switch to
# v1.0.0-rc5 runtime config generation.
ENV RUNC_COMMIT 31980a53ae7887b2c8f8715d13c3eb486c27b6cf
ENV RUNC_COMMIT v1.0.0-rc3
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git fetch origin --tags \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp selinux" \
&& cp runc /usr/local/bin/runc \
Expand Down
19 changes: 14 additions & 5 deletions lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"memo": "1290be673a75036ce5bea81021073dd7041dc3f421446912b6b7ae0ed511fe93",
"memo": "0d3077faf280e4e13e18e56f085053d4ced593c2fcfcb09d7df1aea8f0bba403",
"projects": [
{
"name": "github.com/BurntSushi/toml",
Expand Down Expand Up @@ -35,6 +35,14 @@
"."
]
},
{
"name": "github.com/blang/semver",
"version": "v3.5.0",
"revision": "b38d23b8782a487059e8fc8773e9a5b228a77cb6",
"packages": [
"."
]
},
{
"name": "github.com/containernetworking/cni",
"version": "v0.4.0",
Expand Down Expand Up @@ -325,19 +333,20 @@
},
{
"name": "github.com/opencontainers/runtime-spec",
"branch": "master",
"revision": "bb6925ea99f0e366a3f7d1c975f6577475ca25f0",
"version": "v1.0.0-rc5",
"revision": "035da1dca3dfbb00d752eb58b0b158d6129f3776",
"packages": [
"specs-go"
]
},
{
"name": "github.com/opencontainers/runtime-tools",
"branch": "master",
"revision": "2d92f6557e64d4f9a0e799a75fdf153cec13dffa",
"revision": "18a122b45a71765b09c6a451008a63687040b74a",
"packages": [
"generate",
"generate/seccomp"
"generate/seccomp",
"validate"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"branch": "master"
},
"github.com/opencontainers/runtime-spec": {
"version": "v1.0.0-rc5"
},
"github.com/opencontainers/runtime-tools": {
"branch": "master"
},
"github.com/opencontainers/selinux": {
Expand Down
2 changes: 1 addition & 1 deletion server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,

cpuQuota := resources.CpuQuota
if cpuQuota != 0 {
specgen.SetLinuxResourcesCPUQuota(uint64(cpuQuota))
specgen.SetLinuxResourcesCPUQuota(cpuQuota)
}

cpuShares := resources.CpuShares
Expand Down
20 changes: 10 additions & 10 deletions server/seccomp/seccomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func setupSeccomp(config *Seccomp, specgen *generate.Generator) error {
}

customspec := specgen.Spec()
customspec.Linux.Seccomp = &specs.Seccomp{}
customspec.Linux.Seccomp = &specs.LinuxSeccomp{}

// if config.Architectures == 0 then libseccomp will figure out the architecture to use
if len(config.Architectures) != 0 {
Expand All @@ -99,7 +99,7 @@ func setupSeccomp(config *Seccomp, specgen *generate.Generator) error {
}
}

customspec.Linux.Seccomp.DefaultAction = specs.Action(config.DefaultAction)
customspec.Linux.Seccomp.DefaultAction = specs.LinuxSeccompAction(config.DefaultAction)

Loop:
// Loop through all syscall blocks and convert them to libcontainer format after filtering them
Expand All @@ -111,7 +111,7 @@ Loop:
}
if len(call.Excludes.Caps) > 0 {
for _, c := range call.Excludes.Caps {
if stringutils.InSlice(customspec.Process.Capabilities, c) {
if stringutils.InSlice(customspec.Process.Capabilities.Permitted, c) {
continue Loop
}
}
Expand All @@ -123,7 +123,7 @@ Loop:
}
if len(call.Includes.Caps) > 0 {
for _, c := range call.Includes.Caps {
if !stringutils.InSlice(customspec.Process.Capabilities, c) {
if !stringutils.InSlice(customspec.Process.Capabilities.Permitted, c) {
continue Loop
}
}
Expand All @@ -145,19 +145,19 @@ Loop:
return nil
}

func createSpecsSyscall(name string, action Action, args []*Arg) specs.Syscall {
newCall := specs.Syscall{
Name: name,
Action: specs.Action(action),
func createSpecsSyscall(name string, action Action, args []*Arg) specs.LinuxSyscall {
newCall := specs.LinuxSyscall{
Names: []string{name},
Action: specs.LinuxSeccompAction(action),
}

// Loop through all the arguments of the syscall and convert them
for _, arg := range args {
newArg := specs.Arg{
newArg := specs.LinuxSeccompArg{
Index: arg.Index,
Value: arg.Value,
ValueTwo: arg.ValueTwo,
Op: specs.Operator(arg.Op),
Op: specs.LinuxSeccompOperator(arg.Op),
}

newCall.Args = append(newCall.Args, newArg)
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/blang/semver/.gx/lastpubver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/github.com/blang/semver/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading