Skip to content

Commit ea35825

Browse files
committed
merge branch 'pr-1478'
LGTMs: @cyphar @crosbymichael Closes opencontainers#1478
2 parents 3723495 + 553016d commit ea35825

File tree

14 files changed

+107
-76
lines changed

14 files changed

+107
-76
lines changed

Diff for: exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,5 @@ func getProcess(context *cli.Context, bundle string) (*specs.Process, error) {
208208
}
209209
p.User.UID = uint32(uid)
210210
}
211-
return &p, nil
211+
return p, nil
212212
}

Diff for: libcontainer/setns_init_linux.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
"github.com/opencontainers/runc/libcontainer/seccomp"
1212
"github.com/opencontainers/runc/libcontainer/system"
1313
"github.com/opencontainers/selinux/go-selinux/label"
14+
15+
"golang.org/x/sys/unix"
1416
)
1517

1618
// linuxSetnsInit performs the container's initialization for running a new process
@@ -41,7 +43,7 @@ func (l *linuxSetnsInit) Init() error {
4143
}
4244
}
4345
if l.config.NoNewPrivileges {
44-
if err := system.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
46+
if err := unix.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
4547
return err
4648
}
4749
}

Diff for: libcontainer/specconv/example.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func Example() *specs.Spec {
2323
Path: "rootfs",
2424
Readonly: true,
2525
},
26-
Process: specs.Process{
26+
Process: &specs.Process{
2727
Terminal: true,
2828
User: specs.User{},
2929
Args: []string{

Diff for: libcontainer/specconv/spec_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
230230
config.ProcessLabel = spec.Process.SelinuxLabel
231231
}
232232
config.Sysctl = spec.Linux.Sysctl
233-
if spec.Linux.Resources != nil && spec.Linux.Resources.OOMScoreAdj != nil {
234-
config.OomScoreAdj = *spec.Linux.Resources.OOMScoreAdj
233+
if spec.Process != nil && spec.Process.OOMScoreAdj != nil {
234+
config.OomScoreAdj = *spec.Process.OOMScoreAdj
235235
}
236236
if spec.Process.Capabilities != nil {
237237
config.Capabilities = &configs.Capabilities{

Diff for: libcontainer/standard_init_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (l *linuxStandardInit) Init() error {
128128
return err
129129
}
130130
if l.config.NoNewPrivileges {
131-
if err := system.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
131+
if err := unix.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
132132
return err
133133
}
134134
}

Diff for: libcontainer/system/linux.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,5 @@ func RunningInUserNS() bool {
133133

134134
// SetSubreaper sets the value i as the subreaper setting for the calling process
135135
func SetSubreaper(i int) error {
136-
return Prctl(PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
137-
}
138-
139-
func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) (err error) {
140-
_, _, e1 := unix.Syscall6(unix.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0)
141-
if e1 != 0 {
142-
err = e1
143-
}
144-
return
136+
return unix.Prctl(PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
145137
}

Diff for: spec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func loadSpec(cPath string) (spec *specs.Spec, err error) {
134134
if err = validatePlatform(&spec.Platform); err != nil {
135135
return nil, err
136136
}
137-
return spec, validateProcessSpec(&spec.Process)
137+
return spec, validateProcessSpec(spec.Process)
138138
}
139139

140140
func createLibContainerRlimit(rlimit specs.LinuxRlimit) (configs.Rlimit, error) {

Diff for: tests/integration/update.bats

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function setup() {
3131
"cpus": "0"
3232
},
3333
"blockio": {
34-
"blkioWeight": 1000
34+
"weight": 1000
3535
},
3636
"pids": {
3737
"limit": 20
@@ -184,7 +184,7 @@ function check_cgroup_value() {
184184
"cpus": "0"
185185
},
186186
"blockIO": {
187-
"blkioWeight": 1000
187+
"weight": 1000
188188
},
189189
"pids": {
190190
"limit": 20
@@ -235,7 +235,7 @@ EOF
235235
"cpus": "0"
236236
},
237237
"blockIO": {
238-
"blkioWeight": 1000
238+
"weight": 1000
239239
},
240240
"pids": {
241241
"limit": 20

Diff for: update.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The accepted format is as follow (unchanged values can be omitted):
4747
"mems": ""
4848
},
4949
"blockIO": {
50-
"blkioWeight": 0
50+
"weight": 0
5151
}
5252
}
5353

Diff for: utils_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,5 +392,5 @@ func startContainer(context *cli.Context, spec *specs.Spec, action CtAct, criuOp
392392
action: action,
393393
criuOpts: criuOpts,
394394
}
395-
return r.run(&spec.Process)
395+
return r.run(spec.Process)
396396
}

Diff for: vendor.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OCI runtime-spec. When updating this, make sure you use a version tag rather
22
# than a commit ID so it's much more obvious what version of the spec we are
33
# using.
4-
github.com/opencontainers/runtime-spec v1.0.0-rc5
4+
github.com/opencontainers/runtime-spec 239c4e44f2a612ed85f6db9c66247aa33f437e91
55
# Core libcontainer functionality.
66
github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08
77
github.com/opencontainers/selinux v1.0.0-rc1

Diff for: vendor/github.com/opencontainers/runtime-spec/README.md

+14-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)