File tree 1 file changed +7
-13
lines changed
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ import (
30
30
const specConfig = "config.json"
31
31
32
32
var (
33
- defaultRlimits = []string {
33
+ // http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html
34
+ posixRlimits = []string {
34
35
"RLIMIT_AS" ,
35
36
"RLIMIT_CORE" ,
36
37
"RLIMIT_CPU" ,
@@ -40,24 +41,17 @@ var (
40
41
"RLIMIT_STACK" ,
41
42
}
42
43
43
- defaultLinuxRlimits = []string {
44
- "RLIMIT_AS" ,
45
- "RLIMIT_CORE" ,
46
- "RLIMIT_CPU" ,
47
- "RLIMIT_DATA" ,
48
- "RLIMIT_FSIZE" ,
49
- "RLIMIT_LOCKS" ,
44
+ // https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/getrlimit.2?h=man-pages-4.13
45
+ linuxRlimits = append (posixRlimits , []string {
50
46
"RLIMIT_MEMLOCK" ,
51
47
"RLIMIT_MSGQUEUE" ,
52
48
"RLIMIT_NICE" ,
53
- "RLIMIT_NOFILE" ,
54
49
"RLIMIT_NPROC" ,
55
50
"RLIMIT_RSS" ,
56
51
"RLIMIT_RTPRIO" ,
57
52
"RLIMIT_RTTIME" ,
58
53
"RLIMIT_SIGPENDING" ,
59
- "RLIMIT_STACK" ,
60
- }
54
+ }... )
61
55
62
56
configSchemaTemplate = "https://raw.githubusercontent.com/opencontainers/runtime-spec/v%s/schema/config-schema.json"
63
57
)
@@ -879,14 +873,14 @@ func (v *Validator) rlimitValid(rlimit rspec.POSIXRlimit) (errs error) {
879
873
}
880
874
881
875
if v .platform == "linux" {
882
- for _ , val := range defaultLinuxRlimits {
876
+ for _ , val := range linuxRlimits {
883
877
if val == rlimit .Type {
884
878
return
885
879
}
886
880
}
887
881
errs = multierror .Append (errs , fmt .Errorf ("rlimit type %q is invalid" , rlimit .Type ))
888
882
} else if v .platform == "solaris" {
889
- for _ , val := range defaultRlimits {
883
+ for _ , val := range posixRlimits {
890
884
if val == rlimit .Type {
891
885
return
892
886
}
You can’t perform that action at this time.
0 commit comments