Skip to content

Commit 5be3ce2

Browse files
authored
Merge pull request #1036 from athomason/1035-update-runtime-spec
Update runtime-spec to current upstream
2 parents ce05534 + 98727fb commit 5be3ce2

File tree

8 files changed

+36
-31
lines changed

8 files changed

+36
-31
lines changed

Godeps/Godeps.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/config.go

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/state.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/_workspace/src/github.com/opencontainers/runtime-spec/specs-go/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libcontainer/specconv/spec_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func createCgroupConfig(name string, useSystemdCgroup bool, spec *specs.Spec) (*
258258
Resources: &configs.Resources{},
259259
}
260260

261-
if spec.Linux.CgroupsPath != nil {
261+
if spec.Linux != nil && spec.Linux.CgroupsPath != nil {
262262
myCgroupPath = libcontainerUtils.CleanPath(*spec.Linux.CgroupsPath)
263263
if useSystemdCgroup {
264264
myCgroupPath = *spec.Linux.CgroupsPath
@@ -289,6 +289,9 @@ func createCgroupConfig(name string, useSystemdCgroup bool, spec *specs.Spec) (*
289289
}
290290

291291
c.Resources.AllowedDevices = allowedDevices
292+
if spec.Linux == nil {
293+
return c, nil
294+
}
292295
r := spec.Linux.Resources
293296
if r == nil {
294297
return c, nil

libcontainer/specconv/spec_linux_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ func TestLinuxCgroupsPathSpecified(t *testing.T) {
1212
cgroupsPath := "/user/cgroups/path/id"
1313

1414
spec := &specs.Spec{}
15-
spec.Linux.CgroupsPath = &cgroupsPath
15+
spec.Linux = &specs.Linux{
16+
CgroupsPath: &cgroupsPath,
17+
}
1618

1719
cgroup, err := createCgroupConfig("ContainerID", false, spec)
1820
if err != nil {

spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ container on your host.`,
145145
Options: []string{"nosuid", "noexec", "nodev", "relatime", "ro"},
146146
},
147147
},
148-
Linux: specs.Linux{
148+
Linux: &specs.Linux{
149149
MaskedPaths: []string{
150150
"/proc/kcore",
151151
"/proc/latency_stats",

tests/integration/spec.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function teardown() {
7878
run git reset --hard "${SPEC_COMMIT}"
7979
)
8080
[ "$status" -eq 0 ]
81-
[ -e src/runtime-spec/schema/schema.json ]
81+
[ -e src/runtime-spec/schema/config-schema.json ]
8282

8383
run bash -c "GOPATH='$GOPATH' go get github.com/xeipuuv/gojsonschema"
8484
[ "$status" -eq 0 ]
@@ -89,7 +89,7 @@ function teardown() {
8989
runc spec
9090
[ -e config.json ]
9191

92-
run ./validate src/runtime-spec/schema/schema.json config.json
92+
run ./validate src/runtime-spec/schema/config-schema.json config.json
9393
[ "$status" -eq 0 ]
9494
[[ "${lines[0]}" == *"The document is valid"* ]]
9595
}

0 commit comments

Comments
 (0)