Skip to content

Commit

Permalink
fix ovn eip not calculated (#3477)
Browse files Browse the repository at this point in the history
* fix ovn eip not calculated

* fix: clean vlan subnet after clean vpc

---------

Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
  • Loading branch information
bobz965 committed Dec 1, 2023
1 parent 1476c0a commit cdd4353
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,14 @@ func calcSubnetStatusIP(subnet *kubeovnv1.Subnet, c *Controller) error {
return err
}
usingIPs += float64(len(vips))
ovnEips, err := c.ovnEipsLister.List(labels.SelectorFromSet(labels.Set{
util.SubnetNameLabel: subnet.Name,
}))
if err != nil {
klog.Error(err)
return err
}
usingIPs += float64(len(ovnEips))
if !isOvnSubnet(subnet) {
eips, err := c.iptablesEipsLister.List(
labels.SelectorFromSet(labels.Set{util.SubnetNameLabel: subnet.Name}))
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/ovn-vpc-nat-gw/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
ginkgo.By("Deleting bfd custom vpc " + bfdVpcName)
vpcClient.DeleteSync(bfdVpcName)

ginkgo.By("Deleting underlay vlan subnet")
ginkgo.By("Deleting underlay subnet " + underlaySubnetName)
subnetClient.DeleteSync(underlaySubnetName)

ginkgo.By("Deleting vlan " + vlanName)
vlanClient.Delete(vlanName, metav1.DeleteOptions{})

Expand Down

0 comments on commit cdd4353

Please sign in to comment.