Skip to content

Commit

Permalink
Ensure config is reset before node ip handler tests
Browse files Browse the repository at this point in the history
There was a panic seen in https://github.com/ovn-org/ovn-kubernetes/actions/runs/10077834705/job/27861284436?pr=4560

Due to the watchFactory starting and trying to list NADs would end up
with a NPE, as the client in node for unit test not having NAD support.
The suspect is that global config is not reset during these tests, and
UDN was enabled. This patch resets global config before the test runs to
ensure UDN is disabled as these tests do not require it.

Signed-off-by: Tim Rozet <[email protected]>
  • Loading branch information
trozet committed Jul 24, 2024
1 parent 0038e5b commit c53542d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go-controller/pkg/node/node_ip_handler_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ var _ = Describe("Node IP Handler tests", func() {
Output: dummyBrInternalIPv4,
})
Expect(util.SetExec(fexec)).ShouldNot(HaveOccurred())
// Restore global default values before each testcase
Expect(config.PrepareTestConfig()).To(Succeed())
config.IPv4Mode = true
config.IPv6Mode = true
tc = configureKubeOVNContextWithNs(nodeName)
Expand Down

0 comments on commit c53542d

Please sign in to comment.