From db5f2f40fbd46b17ae8481bf4347cfda42be3c85 Mon Sep 17 00:00:00 2001 From: Jana Radhakrishnan Date: Wed, 27 May 2015 23:49:32 +0000 Subject: [PATCH] Removee the init time cleanup of namespace files Removing this as this may cause problems when multiple instances are e running. Signed-off-by: Jana Radhakrishnan --- libnetwork/sandbox/namespace_linux.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/libnetwork/sandbox/namespace_linux.go b/libnetwork/sandbox/namespace_linux.go index 68692b770c..97ea548ca2 100644 --- a/libnetwork/sandbox/namespace_linux.go +++ b/libnetwork/sandbox/namespace_linux.go @@ -5,7 +5,6 @@ import ( "net" "os" "os/exec" - "path/filepath" "runtime" "sync" "syscall" @@ -48,9 +47,6 @@ func createBasePath() { panic("Could not create net namespace path directory") } - // cleanup any stale namespace files if any - cleanupNamespaceFiles() - // Start the garbage collection go routine go removeUnusedPaths() } @@ -155,24 +151,6 @@ func createNetworkNamespace(path string, osCreate bool) (*Info, error) { return info, nil } -func cleanupNamespaceFiles() { - filepath.Walk(prefix, func(path string, info os.FileInfo, err error) error { - stat, err := os.Stat(path) - if err != nil { - return err - } - - if stat.IsDir() { - return filepath.SkipDir - } - - syscall.Unmount(path, syscall.MNT_DETACH) - os.Remove(path) - - return nil - }) -} - func unmountNamespaceFile(path string) { if _, err := os.Stat(path); err == nil { syscall.Unmount(path, syscall.MNT_DETACH)