Skip to content

Commit 58c534d

Browse files
committed
go.{mod,sum}: bump runtime-spec to v1.3.0.
Bump runtime-spec to v1.3.0. Unfortunately there is a backward incompatible change there switching the Linux PID limit from int64 to *int64. Update generate/generate.go accordingly. Also, add a constant UnlimitedPidsLimit with the correct PID limit indicating "unlimited". Signed-off-by: Krisztian Litkey <[email protected]>
1 parent 79a3f0f commit 58c534d

File tree

7 files changed

+231
-37
lines changed

7 files changed

+231
-37
lines changed

cgroups/cgroups_v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ func (cg *CgroupV1) GetPidsData(pid int, cgPath string) (*rspec.LinuxPids, error
679679

680680
return nil, err
681681
}
682-
lp.Limit = res
682+
lp.Limit = &res
683683

684684
return lp, nil
685685
}

generate/generate.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ var (
2626
}
2727
)
2828

29+
const (
30+
// UnlimitedPidsLimit can be passed to SetLinuxResourcesPidsLimit to
31+
// request unlimited PIDs.
32+
UnlimitedPidsLimit int64 = -1
33+
)
34+
2935
// Generator represents a generator for a container config.
3036
type Generator struct {
3137
Config *rspec.Spec
@@ -970,7 +976,7 @@ func (g *Generator) DropLinuxResourcesNetworkPriorities(name string) {
970976
// SetLinuxResourcesPidsLimit sets g.Config.Linux.Resources.Pids.Limit.
971977
func (g *Generator) SetLinuxResourcesPidsLimit(limit int64) {
972978
g.initConfigLinuxResourcesPids()
973-
g.Config.Linux.Resources.Pids.Limit = limit
979+
g.Config.Linux.Resources.Pids.Limit = &limit
974980
}
975981

976982
// ClearLinuxSysctl clears g.Config.Linux.Sysctl.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/moby/sys/capability v0.4.0
1111
github.com/moby/sys/mountinfo v0.7.2
1212
github.com/mrunalp/fileutils v0.5.0
13-
github.com/opencontainers/runtime-spec v1.1.0
13+
github.com/opencontainers/runtime-spec v1.3.0
1414
github.com/opencontainers/selinux v1.9.1
1515
github.com/sirupsen/logrus v1.8.1
1616
github.com/stretchr/testify v1.3.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
1111
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
1212
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b h1:Ga1nclDSe8gOw37MVLMhfu2QKWtD6gvtQ298zsKVh8g=
1313
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
14-
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
15-
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
1614
github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk=
1715
github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=
16+
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
17+
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
1818
github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4=
1919
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
20-
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
21-
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
20+
github.com/opencontainers/runtime-spec v1.3.0 h1:YZupQUdctfhpZy3TM39nN9Ika5CBWT5diQ8ibYCRkxg=
21+
github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
2222
github.com/opencontainers/selinux v1.9.1 h1:b4VPEF3O5JLZgdTDBmGepaaIbAo0GqoF6EBRq5f/g3Y=
2323
github.com/opencontainers/selinux v1.9.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
2424
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

0 commit comments

Comments
 (0)