From bb7a0aa3237b4791eec6ead85a20df8d06e70c82 Mon Sep 17 00:00:00 2001 From: bobz965 Date: Wed, 21 Feb 2024 17:06:22 +0800 Subject: [PATCH] optimize Signed-off-by: bobz965 --- pkg/controller/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/init.go b/pkg/controller/init.go index 6cc2f6d49e50..d943e15047e0 100644 --- a/pkg/controller/init.go +++ b/pkg/controller/init.go @@ -886,7 +886,7 @@ func (c *Controller) syncFinalizers() error { } func (c *Controller) ReplaceFinalizer(cachedObj client.Object) ([]byte, error) { - if slices.Contains(cachedObj.GetFinalizers(), util.DepreciatedFinalizerName) { + if controllerutil.ContainsFinalizer(cachedObj, util.DepreciatedFinalizerName) { newObj := cachedObj.DeepCopyObject().(client.Object) controllerutil.RemoveFinalizer(newObj, util.DepreciatedFinalizerName) controllerutil.AddFinalizer(newObj, util.KubeOVNControllerFinalizer)