diff --git a/apis/keda/v1alpha1/scaledobject_webhook.go b/apis/keda/v1alpha1/scaledobject_webhook.go index b487024b013..f8680a48b58 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook.go +++ b/apis/keda/v1alpha1/scaledobject_webhook.go @@ -124,7 +124,7 @@ func isRemovingFinalizer(so *ScaledObject, old runtime.Object) bool { soSpecString := string(soSpec) oldSoSpecString := string(oldSoSpec) - return len(so.ObjectMeta.Finalizers) == 0 && len(oldSo.ObjectMeta.Finalizers) == 1 && soSpecString == oldSoSpecString + return len(so.ObjectMeta.Finalizers) < len(oldSo.ObjectMeta.Finalizers) && soSpecString == oldSoSpecString } func validateWorkload(so *ScaledObject, action string, dryRun bool) (admission.Warnings, error) {