Skip to content

Commit

Permalink
Services E2Es: Reset test variables before each test
Browse files Browse the repository at this point in the history
Fixes: ovn-org#4733

Signed-off-by: Patryk Diak <[email protected]>
  • Loading branch information
kyrtapz committed Sep 19, 2024
1 parent 8017e9a commit d6f145e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/e2e/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,8 @@ var _ = ginkgo.Describe("Services", func() {
var nodes *v1.NodeList
var err error
nodeIPs := make(map[string]map[int]string)
var egressPod *v1.Pod
var egressNode string
targetSecondaryNode := node{
name: "egressSecondaryTargetNode-allowed",
}
var targetSecondaryNode node

const (
endpointHTTPPort = 80
Expand All @@ -722,6 +719,14 @@ var _ = ginkgo.Describe("Services", func() {
clientContainerName = "npclient"
)

ginkgo.BeforeEach(func() {
nodeIPs = make(map[string]map[int]string)
egressNode = ""
targetSecondaryNode = node{
name: "egressSecondaryTargetNode-allowed",
}
})

ginkgo.AfterEach(func() {
ginkgo.By("Cleaning up external container")
deleteClusterExternalContainer(clientContainerName)
Expand All @@ -745,7 +750,6 @@ var _ = ginkgo.Describe("Services", func() {
e2ekubectl.RunKubectlOrDie("default", "delete", "eip", "egressip", "--ignore-not-found=true")
e2ekubectl.RunKubectlOrDie("default", "label", "node", egressNode, "k8s.ovn.org/egress-assignable-")
tearDownNetworkAndTargetForMultiNIC([]string{egressNode}, targetSecondaryNode)
targetSecondaryNode.nodeIP = ""
}
})

Expand Down Expand Up @@ -924,7 +928,7 @@ var _ = ginkgo.Describe("Services", func() {
}

ginkgo.By("Choosing egressIP pod")
egressPod = endPoints[0]
egressPod := endPoints[0]
framework.Logf("EgressIP pod is %s/%s", endPoints[0].Namespace, endPoints[0].Name)

ginkgo.By("Label egress node" + egressNode + " create external container to send egress traffic to via secondary MultiNIC EIP")
Expand Down

0 comments on commit d6f145e

Please sign in to comment.