Skip to content

Commit 2fe25af

Browse files
committed
mgmtfn/k8splugin: fix test setup
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
1 parent 38f02ee commit 2fe25af

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mgmtfn/k8splugin/driver_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ func (s *NetSetup) SetUpTest(c *C) {
5555
}
5656
s.globalNS = globalNS
5757
defer func() {
58-
netns.Set(globalNS)
58+
currNS, _ := netns.Get()
59+
if !globalNS.Equal(currNS) {
60+
netns.Set(globalNS)
61+
}
5962
}()
6063

6164
newNS, err := netns.New()

0 commit comments

Comments
 (0)