Skip to content

Commit

Permalink
fix isRemovingFinalizer in webhook (#5317)
Browse files Browse the repository at this point in the history
Signed-off-by: Or Koren <[email protected]>
  • Loading branch information
similark authored Jan 1, 2024
1 parent 4ec4a32 commit 8e2e9f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/keda/v1alpha1/scaledobject_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8e2e9f4

Please sign in to comment.