diff --git a/controllers/configurationpolicy_controller.go b/controllers/configurationpolicy_controller.go index 80fe6686..73dc9a33 100644 --- a/controllers/configurationpolicy_controller.go +++ b/controllers/configurationpolicy_controller.go @@ -192,7 +192,9 @@ func (r *ConfigurationPolicyReconciler) PeriodicallyExecConfigPolicies(freq uint needDeploymentFinalizer := false - for _, plc := range policiesList.Items { + for i := range policiesList.Items { + plc := policiesList.Items[i] + if objHasFinalizer(&plc, pruneObjectFinalizer) { needDeploymentFinalizer = true