Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ovn eip not calculated #3477

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,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
10 changes: 6 additions & 4 deletions test/e2e/ovn-vpc-nat-gw/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,18 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
subnetClient.DeleteSync(noBfdExtraSubnetName)
ginkgo.By("Deleting subnet " + bfdSubnetName)
subnetClient.DeleteSync(bfdSubnetName)
ginkgo.By("Deleting underlay subnet " + underlaySubnetName)
subnetClient.DeleteSync(underlaySubnetName)
ginkgo.By("Deleting extra underlay subnet " + underlayExtraSubnetName)
subnetClient.DeleteSync(underlayExtraSubnetName)

ginkgo.By("Deleting no bfd custom vpc " + noBfdVpcName)
vpcClient.DeleteSync(noBfdVpcName)
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 extra underlay subnet " + underlayExtraSubnetName)
subnetClient.DeleteSync(underlayExtraSubnetName)

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

Expand Down
Loading