github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/oci/namespaces.go (about) 1 package oci // import "github.com/docker/docker/oci" 2 3 import specs "github.com/opencontainers/runtime-spec/specs-go" 4 5 // RemoveNamespace removes the `nsType` namespace from OCI spec `s` 6 func RemoveNamespace(s *specs.Spec, nsType specs.LinuxNamespaceType) { 7 for i, n := range s.Linux.Namespaces { 8 if n.Type == nsType { 9 s.Linux.Namespaces = append(s.Linux.Namespaces[:i], s.Linux.Namespaces[i+1:]...) 10 return 11 } 12 } 13 }