Skip to content

Commit c0f15a6

Browse files
committed
mgmtfn/k8splugin: fix test setup
Signed-off-by: Cristian Staretu <[email protected]>
1 parent c76d616 commit c0f15a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)