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 snat and fip delete #2584

Merged
merged 2 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkg/controller/ovn_fip.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ func (c *Controller) handleDelOvnFip(key string) error {
return err
}
// ovn delete fip
if err = c.ovnLegacyClient.DeleteFipRule(cachedFip.Status.Vpc, cachedFip.Status.V4Eip, cachedFip.Status.V4Ip); err != nil {
klog.Errorf("failed to create fip, %v", err)
return err
if cachedFip.Status.Ready {
ShaPoHun marked this conversation as resolved.
Show resolved Hide resolved
if err = c.ovnLegacyClient.DeleteFipRule(cachedFip.Status.Vpc, cachedFip.Status.V4Eip, cachedFip.Status.V4Ip); err != nil {
klog.Errorf("failed to delete fip, %v", err)
return err
}
}
if err = c.handleDelOvnFipFinalizer(cachedFip); err != nil {
klog.Errorf("failed to handle remove finalizer from ovn fip, %v", err)
Expand Down
8 changes: 5 additions & 3 deletions pkg/controller/ovn_snat.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,11 @@ func (c *Controller) handleUpdateOvnSnatRule(key string) error {
if !cachedSnat.DeletionTimestamp.IsZero() {
klog.V(3).Infof("ovn clean snat %s", key)
// ovn delete snat
if err = c.ovnLegacyClient.DeleteSnatRule(cachedSnat.Status.Vpc, cachedEip.Spec.V4Ip, cachedSnat.Status.V4IpCidr); err != nil {
klog.Errorf("failed to delte snat, %v", err)
return err
if cachedSnat.Status.Ready {
if err = c.ovnLegacyClient.DeleteSnatRule(cachedSnat.Status.Vpc, cachedEip.Spec.V4Ip, cachedSnat.Status.V4IpCidr); err != nil {
klog.Errorf("failed to delete snat, %v", err)
return err
}
}
// reset eip
c.resetOvnEipQueue.Add(cachedSnat.Spec.OvnEip)
Expand Down