File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,6 +195,8 @@ func checkProcess(process rspec.Process, rootfs string) {
195195//Linux only
196196func checkLinux (spec rspec.Spec ) {
197197 utsExists := false
198+ ipcExists := false
199+ netExists := false
198200
199201 if len (spec .Linux .UIDMappings ) > 5 {
200202 logrus .Fatalf ("Only 5 UID mappings are allowed (linux kernel restriction)." )
@@ -208,6 +210,19 @@ func checkLinux(spec rspec.Spec) {
208210 logrus .Fatalf ("namespace %v is invalid." , spec .Linux .Namespaces [index ])
209211 } else if spec .Linux .Namespaces [index ].Type == rspec .UTSNamespace {
210212 utsExists = true
213+ } else if spec .Linux .Namespaces [index ].Type == rspec .IPCNamespace {
214+ ipcExists = true
215+ } else if spec .Linux .Namespaces [index ].Type == rspec .NetworkNamespace {
216+ netExists = true
217+ }
218+ }
219+
220+ for k , v := range spec .Linux .Sysctl {
221+ if strings .HasPrefix (k , "net." ) && ! netExists {
222+ logrus .Fatalf ("Sysctl %v requires a new Network namespace to be specified as well" , k )
223+ }
224+ if strings .HasPrefix (k , "fs.mqueue." ) && ! ipcExists {
225+ logrus .Fatalf ("Sysctl %v requires a new IPC namespace to be specified as well" , k )
211226 }
212227 }
213228
You can’t perform that action at this time.
0 commit comments