Remove redundant declaraion of namespace slice
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
This commit is contained in:
parent
c8452121d5
commit
22953c122f
|
@ -64,12 +64,12 @@ func IsNamespaceSupported(ns NamespaceType) bool {
|
|||
|
||||
func NamespaceTypes() []NamespaceType {
|
||||
return []NamespaceType{
|
||||
NEWUSER, // Keep user NS always first, don't move it.
|
||||
NEWIPC,
|
||||
NEWUTS,
|
||||
NEWNET,
|
||||
NEWPID,
|
||||
NEWNS,
|
||||
NEWUTS,
|
||||
NEWIPC,
|
||||
NEWUSER,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1444,17 +1444,8 @@ func (c *linuxContainer) currentState() (*State, error) {
|
|||
// can setns in order.
|
||||
func (c *linuxContainer) orderNamespacePaths(namespaces map[configs.NamespaceType]string) ([]string, error) {
|
||||
paths := []string{}
|
||||
order := []configs.NamespaceType{
|
||||
// The user namespace *must* be done first.
|
||||
configs.NEWUSER,
|
||||
configs.NEWIPC,
|
||||
configs.NEWUTS,
|
||||
configs.NEWNET,
|
||||
configs.NEWPID,
|
||||
configs.NEWNS,
|
||||
}
|
||||
|
||||
for _, ns := range order {
|
||||
for _, ns := range configs.NamespaceTypes() {
|
||||
|
||||
// Remove namespaces that we don't need to join.
|
||||
if !c.config.Namespaces.Contains(ns) {
|
||||
|
|
Loading…
Reference in New Issue