Skip to content

Commit 89a9fdd

Browse files
author
liwenjian
committed
fix issue 5167: Add Finalizer when create snat
1 parent 0a660de commit 89a9fdd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/controller/vpc_nat_gw_nat.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,7 @@ func (c *Controller) handleDelIptablesSnatFinalizer(key string) error {
961961
return nil
962962
}
963963
newIptablesSnat := cachedIptablesSnat.DeepCopy()
964-
controllerutil.RemoveFinalizer(newIptablesSnat, util.DepreciatedFinalizerName)
965-
controllerutil.RemoveFinalizer(newIptablesSnat, util.KubeOVNControllerFinalizer)
964+
controllerutil.AddFinalizer(newIptablesSnat, util.KubeOVNControllerFinalizer)
966965
patch, err := util.GenerateMergePatchPayload(cachedIptablesSnat, newIptablesSnat)
967966
if err != nil {
968967
klog.Errorf("failed to generate patch payload for iptables snat '%s', %v", cachedIptablesSnat.Name, err)

0 commit comments

Comments
 (0)