Skip to content

Commit b7459bd

Browse files
Alexander Zielenskik8s-publishing-bot
authored andcommitted
bugfix: dont skip reconcile for unchanged policy if last sync failed
Kubernetes-commit: cc819ed4ae7b75d0e28f567dac8c8282b647369a
1 parent e9b5722 commit b7459bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ func (c *policyController) reconcilePolicyDefinitionSpec(namespace, name string,
180180
celmetrics.Metrics.ObserveDefinition(context.TODO(), "active", "deny")
181181
}
182182

183-
// Skip reconcile if the spec of the definition is unchanged
184-
if info.lastReconciledValue != nil && definition != nil &&
183+
// Skip reconcile if the spec of the definition is unchanged and had a
184+
// successful previous sync
185+
if info.configurationError == nil && info.lastReconciledValue != nil && definition != nil &&
185186
apiequality.Semantic.DeepEqual(info.lastReconciledValue.Spec, definition.Spec) {
186187
return nil
187188
}

0 commit comments

Comments
 (0)