Skip to content

Commit 6f4243a

Browse files
Backport: fix(vmip): remove legacy finalizer (#1223)
fix(vmip): remove legacy finalizer (#1220) Remove legacy finalizer virtualization.deckhouse.io/vmip-protection from VirtualMachineIPAddress resources. It no longer attaches to new resources, but must be removed from old ones. Signed-off-by: Isteb4k <[email protected]> Co-authored-by: Dmitry Rakitin <[email protected]>
1 parent a659c34 commit 6f4243a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

api/core/v1alpha2/finalizers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const (
2121
FinalizerVIProtection = "virtualization.deckhouse.io/vi-protection"
2222
FinalizerVDProtection = "virtualization.deckhouse.io/vd-protection"
2323
FinalizerKVVMProtection = "virtualization.deckhouse.io/kvvm-protection"
24+
FinalizerIPAddressProtection = "virtualization.deckhouse.io/vmip-protection"
2425
FinalizerPodProtection = "virtualization.deckhouse.io/pod-protection"
2526
FinalizerVDSnapshotProtection = "virtualization.deckhouse.io/vdsnapshot-protection"
2627
FinalizerVMSnapshotProtection = "virtualization.deckhouse.io/vmsnapshot-protection"

images/virtualization-artifact/pkg/controller/vmip/internal/protection_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ func (h *ProtectionHandler) Handle(_ context.Context, vmip *virtv2.VirtualMachin
5050

5151
// 3. All checks have passed, the resource can be deleted.
5252
controllerutil.RemoveFinalizer(vmip, virtv2.FinalizerIPAddressCleanup)
53+
54+
// 4. Remove legacy finalizer as well. It no longer attaches to new resources, but must be removed from old ones.
55+
controllerutil.RemoveFinalizer(vmip, virtv2.FinalizerIPAddressProtection)
56+
5357
return reconcile.Result{}, nil
5458
}

0 commit comments

Comments
 (0)