Skip to content

Commit

Permalink
bugfix: dont skip reconcile for unchanged policy if last sync failed
Browse files Browse the repository at this point in the history
Kubernetes-commit: cc819ed4ae7b75d0e28f567dac8c8282b647369a
  • Loading branch information
Alexander Zielenski authored and k8s-publishing-bot committed Jan 27, 2024
1 parent e9b5722 commit b7459bd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ func (c *policyController) reconcilePolicyDefinitionSpec(namespace, name string,
celmetrics.Metrics.ObserveDefinition(context.TODO(), "active", "deny")
}

// Skip reconcile if the spec of the definition is unchanged
if info.lastReconciledValue != nil && definition != nil &&
// Skip reconcile if the spec of the definition is unchanged and had a
// successful previous sync
if info.configurationError == nil && info.lastReconciledValue != nil && definition != nil &&
apiequality.Semantic.DeepEqual(info.lastReconciledValue.Spec, definition.Spec) {
return nil
}
Expand Down

0 comments on commit b7459bd

Please sign in to comment.