Skip to content

Commit

Permalink
Merge pull request #4924 from martinkennelly/revert-usage-gv1-dsc-table
Browse files Browse the repository at this point in the history
Ensure only ginkgo v2 for DescribeTable support
  • Loading branch information
trozet authored Dec 18, 2024
2 parents 706435b + 5e6160d commit 75499ab
Show file tree
Hide file tree
Showing 49 changed files with 143 additions and 4,816 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (c *Controller) syncNode(key string) error {
// address changes regardless of allocated services.
network := util.DefaultNetInfo{}
networkName := network.GetNetworkName()
err = c.ensureNoRerouteNodePolicies(c.nbClient, c.addressSetFactory, networkName, c.controllerName, c.GetNetworkScopedClusterRouterName(), c.nodeLister, config.IPv4Mode, config.IPv6Mode)
err = c.ensureNoRerouteNodePolicies(c.nbClient, c.addressSetFactory, networkName, c.GetNetworkScopedClusterRouterName(), c.controllerName, c.nodeLister, config.IPv4Mode, config.IPv6Mode)
if err != nil {
return err
}
Expand Down
169 changes: 99 additions & 70 deletions go-controller/pkg/ovn/egressip_test.go

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions go-controller/pkg/ovn/egressservices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net"

ginkgotable "github.com/onsi/ginkgo/extensions/table"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"

Expand Down Expand Up @@ -569,7 +568,7 @@ var _ = ginkgo.Describe("OVN Egress Service Operations", func() {

ginkgo.Context("on egress service changes", func() {

ginkgotable.DescribeTable("should create/update/delete OVN configuration", func(interconnectEnabled bool) {
ginkgo.DescribeTable("should create/update/delete OVN configuration", func(interconnectEnabled bool) {
app.Action = func(ctx *cli.Context) error {
namespaceT := *newNamespace("testns")
config.IPv6Mode = true
Expand Down Expand Up @@ -781,11 +780,11 @@ var _ = ginkgo.Describe("OVN Egress Service Operations", func() {
err := app.Run([]string{app.Name})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
},
ginkgotable.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgotable.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true),
ginkgo.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgo.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true),
)

ginkgotable.DescribeTable("should delete resources when host changes to ALL", func(interconnectEnabled bool) {
ginkgo.DescribeTable("should delete resources when host changes to ALL", func(interconnectEnabled bool) {
app.Action = func(ctx *cli.Context) error {
namespaceT := *newNamespace("testns")
config.IPv6Mode = true
Expand Down Expand Up @@ -948,12 +947,12 @@ var _ = ginkgo.Describe("OVN Egress Service Operations", func() {
err := app.Run([]string{app.Name})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
},
ginkgotable.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgotable.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
ginkgo.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgo.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
})

ginkgo.Context("on endpointslices changes", func() {
ginkgotable.DescribeTable("should create/update/delete OVN configuration", func(interconnectEnabled bool) {
ginkgo.DescribeTable("should create/update/delete OVN configuration", func(interconnectEnabled bool) {
app.Action = func(ctx *cli.Context) error {
namespaceT := *newNamespace("testns")
config.IPv6Mode = true
Expand Down Expand Up @@ -1265,12 +1264,12 @@ var _ = ginkgo.Describe("OVN Egress Service Operations", func() {
err := app.Run([]string{app.Name})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
},
ginkgotable.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgotable.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
ginkgo.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgo.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
})

ginkgo.Context("on nodes changes", func() {
ginkgotable.DescribeTable("should create/update/delete logical router policies and address sets", func(interconnectEnabled bool) {
ginkgo.DescribeTable("should create/update/delete logical router policies and address sets", func(interconnectEnabled bool) {
app.Action = func(ctx *cli.Context) error {
namespaceT := *newNamespace("testns")
config.IPv6Mode = true
Expand Down Expand Up @@ -1570,8 +1569,8 @@ var _ = ginkgo.Describe("OVN Egress Service Operations", func() {
err := app.Run([]string{app.Name})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
},
ginkgotable.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgotable.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
ginkgo.Entry("IC Disabled, all nodes are in a single zone", false),
ginkgo.Entry("IC Enabled, node1 is in the local zone, node2 in remote", true))
})

})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/types"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/util"

ginkgotable "github.com/onsi/ginkgo/extensions/table"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
)
Expand Down Expand Up @@ -66,12 +65,12 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
)

ginkgo.Context("EgressIP", func() {
ginkgotable.DescribeTable("reroutes", func(sync lrpSync) {
ginkgo.DescribeTable("reroutes", func(sync lrpSync) {
// pod reroutes may not have any owner references besides 'name' which equals EgressIP name
performTest(defaultNetworkControllerName, sync.initialLRPs, sync.finalLRPs, sync.v4ClusterSubnets, sync.v6ClusterSubnets,
sync.v4JoinSubnet, sync.v6JoinSubnet, sync.pods)
},
ginkgotable.Entry("add reference to IPv4 LRP with no reference", lrpSync{
ginkgo.Entry("add reference to IPv4 LRP with no reference", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v4PodIPStr, 0, v4IPFamilyValue,
v4PodNextHops, map[string]string{"name": egressIPName}, defaultNetworkControllerName)},
finalLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v4PodIPStr, 0, v4IPFamilyValue, v4PodNextHops,
Expand All @@ -82,7 +81,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v4JoinSubnet: v4JoinSubnet,
pods: podsNetInfo{v4PodNetInfo, v6PodNetInfo, v4Pod2NetInfo},
}),
ginkgotable.Entry("add reference to IPv6 LRP with no reference", lrpSync{
ginkgo.Entry("add reference to IPv6 LRP with no reference", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v6PodIPStr, 0, v6IPFamilyValue,
v6PodNextHops, map[string]string{"name": egressIPName}, defaultNetworkControllerName)},
finalLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v6PodIPStr, 0, v6IPFamilyValue, v6PodNextHops,
Expand All @@ -92,7 +91,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v6JoinSubnet: v6JoinSubnet,
pods: podsNetInfo{v4PodNetInfo, v6PodNetInfo, v4Pod2NetInfo},
}),
ginkgotable.Entry("add references to IPv4 & IPv6 (dual) LRP with no references", lrpSync{
ginkgo.Entry("add references to IPv4 & IPv6 (dual) LRP with no references", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{
getReRouteLRP(podNamespace, podName, v4PodIPStr, 0, v4IPFamilyValue, v4PodNextHops, map[string]string{"name": egressIPName}, defaultNetworkControllerName),
getReRouteLRP(podNamespace, podName, v6PodIPStr, 0, v6IPFamilyValue, v6PodNextHops, map[string]string{"name": egressIPName}, defaultNetworkControllerName)},
Expand All @@ -107,7 +106,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v6JoinSubnet: v6JoinSubnet,
pods: podsNetInfo{v4PodNetInfo, v6PodNetInfo, v4Pod2NetInfo},
}),
ginkgotable.Entry("does not modify IPv4 LRP which contains a reference", lrpSync{
ginkgo.Entry("does not modify IPv4 LRP which contains a reference", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v4PodIPStr, 0, v4IPFamilyValue, v4PodNextHops,
getEgressIPLRPReRouteDbIDs(egressIPName, podNamespace, podName, v4IPFamilyValue, defaultNetworkName, defaultNetworkControllerName).GetExternalIDs(),
defaultNetworkControllerName)},
Expand All @@ -118,7 +117,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v4JoinSubnet: v4JoinSubnet,
pods: podsNetInfo{v4PodNetInfo},
}),
ginkgotable.Entry("does not return error when unable to build a reference because of failed pod IP lookup", lrpSync{
ginkgo.Entry("does not return error when unable to build a reference because of failed pod IP lookup", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{getReRouteLRP(podNamespace, podName, v4PodIPStr, 0, v4IPFamilyValue, v4PodNextHops,
map[string]string{"name": egressIPName},
defaultNetworkControllerName)},
Expand All @@ -131,12 +130,12 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
}),
)

ginkgotable.DescribeTable("pod to join, pod to pod, pod to node aka 'no reroutes'", func(sync lrpSync) {
ginkgo.DescribeTable("pod to join, pod to pod, pod to node aka 'no reroutes'", func(sync lrpSync) {
// pod to join LRPs may not have any owner references specified
performTest(defaultNetworkControllerName, sync.initialLRPs, sync.finalLRPs, sync.v4ClusterSubnets, sync.v6ClusterSubnets,
sync.v4JoinSubnet, sync.v6JoinSubnet, nil)
},
ginkgotable.Entry("does not modify LRP with owner references", lrpSync{
ginkgo.Entry("does not modify LRP with owner references", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{getNoReRouteLRP(fmt.Sprintf("ip4.src == %s && ip4.dst == %s", v4PodClusterSubnetStr, v4JoinSubnetStr),
getEgressIPLRPNoReRoutePodToJoinDbIDs(v4IPFamilyValue, defaultNetworkName, "controller").GetExternalIDs(), nil),
},
Expand All @@ -147,7 +146,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v4ClusterSubnets: []*net.IPNet{v4PodClusterSubnet},
v4JoinSubnet: v4JoinSubnet,
}),
ginkgotable.Entry("updates IPv4 pod to pod, pod to join, pod to node with no references and does not modify LRP with references", lrpSync{
ginkgo.Entry("updates IPv4 pod to pod, pod to join, pod to node with no references and does not modify LRP with references", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{
{
Priority: types.DefaultNoRereoutePriority,
Expand Down Expand Up @@ -212,7 +211,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v6ClusterSubnets: []*net.IPNet{v6PodClusterSubnet},
v6JoinSubnet: v6JoinSubnet,
}),
ginkgotable.Entry("updates IPv6 pod to pod, pod to join with no references and does not modify LRP with references", lrpSync{
ginkgo.Entry("updates IPv6 pod to pod, pod to join with no references and does not modify LRP with references", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{
{
Priority: types.DefaultNoRereoutePriority,
Expand Down Expand Up @@ -275,7 +274,7 @@ var _ = ginkgo.Describe("OVN Logical Router Syncer", func() {
v6ClusterSubnets: []*net.IPNet{v6PodClusterSubnet},
v6JoinSubnet: v6JoinSubnet,
}),
ginkgotable.Entry("updates IPv4 & IPv6 pod to pod, pod to join with no references and does not modify LRP with references", lrpSync{
ginkgo.Entry("updates IPv4 & IPv6 pod to pod, pod to join with no references and does not modify LRP with references", lrpSync{
initialLRPs: []*nbdb.LogicalRouterPolicy{
{
Priority: types.DefaultNoRereoutePriority,
Expand Down
11 changes: 5 additions & 6 deletions go-controller/pkg/ovn/external_ids_syncer/nat/nat_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
libovsdbtest "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/testing/libovsdb"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/util"

ginkgotable "github.com/onsi/ginkgo/extensions/table"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
)
Expand Down Expand Up @@ -52,9 +51,9 @@ var _ = ginkgo.Describe("NAT Syncer", func() {

ginkgo.Context("EgressIP", func() {

ginkgotable.DescribeTable("egress NATs", func(sync natSync) {
ginkgo.DescribeTable("egress NATs", func(sync natSync) {
performTest(defaultNetworkControllerName, sync.initialNATs, sync.finalNATs, sync.pods)
}, ginkgotable.Entry("converts legacy IPv4 NATs", natSync{
}, ginkgo.Entry("converts legacy IPv4 NATs", natSync{
initialNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V4CIDRStr, egressIP, legacyExtIDs)},
finalNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V4CIDRStr, egressIP, pod1V4ExtIDs)},
pods: podsNetInfo{
Expand All @@ -70,7 +69,7 @@ var _ = ginkgo.Describe("NAT Syncer", func() {
},
},
}),
ginkgotable.Entry("converts legacy IPv6 NATs", natSync{
ginkgo.Entry("converts legacy IPv6 NATs", natSync{
initialNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V6CIDRStr, egressIP, legacyExtIDs)},
finalNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V6CIDRStr, egressIP, pod1V6ExtIDs)},
pods: podsNetInfo{
Expand All @@ -86,7 +85,7 @@ var _ = ginkgo.Describe("NAT Syncer", func() {
},
},
}),
ginkgotable.Entry("converts legacy dual stack NATs", natSync{
ginkgo.Entry("converts legacy dual stack NATs", natSync{
initialNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V4CIDRStr, egressIP, legacyExtIDs), getSNAT(nat2UUID, pod1V6CIDRStr, egressIP, legacyExtIDs)},
finalNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V4CIDRStr, egressIP, pod1V4ExtIDs), getSNAT(nat2UUID, pod1V6CIDRStr, egressIP, pod1V6ExtIDs)},
pods: podsNetInfo{
Expand All @@ -102,7 +101,7 @@ var _ = ginkgo.Describe("NAT Syncer", func() {
},
},
}),
ginkgotable.Entry("doesn't alter NAT with correct external IDs", natSync{
ginkgo.Entry("doesn't alter NAT with correct external IDs", natSync{
initialNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V6CIDRStr, egressIP, pod1V6ExtIDs)},
finalNATs: []*nbdb.NAT{getSNAT(nat1UUID, pod1V6CIDRStr, egressIP, pod1V6ExtIDs)},
pods: podsNetInfo{
Expand Down
3 changes: 3 additions & 0 deletions go-controller/pkg/ovn/ovn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ func (o *FakeOVN) init(nadList []nettypes.NetworkAttachmentDefinition) {
err = o.watcher.Start()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

err = o.eIPController.SyncLocalNodeZonesCache()
gomega.Expect(err).ShouldNot(gomega.HaveOccurred(), "syncing Nodes OVN zones status must succeed to support EgressIP")

existingNodes, err := o.controller.kube.GetNodes()
if err == nil {
for _, node := range existingNodes {
Expand Down
20 changes: 0 additions & 20 deletions go-controller/vendor/github.com/onsi/ginkgo/LICENSE

This file was deleted.

Loading

0 comments on commit 75499ab

Please sign in to comment.