Skip to content

Commit

Permalink
Merge pull request #665 from fxierh/enqueue-cloudcredential
Browse files Browse the repository at this point in the history
OCPBUGS-28388: Fix the ClusterOperator watch of the status controller
  • Loading branch information
openshift-merge-bot[bot] authored Feb 6, 2024
2 parents a440ba8 + 07a7796 commit a24c87e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/operator/status/status_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,15 @@ func Add(mgr, rootCredentialManager manager.Manager, kubeConfig string) error {
}

// always reconcile status when the clusteroperator/cloud-credential changes.
if err := c.Watch(source.Kind(operatorCache, &configv1.ClusterOperator{}), &handler.EnqueueRequestForObject{}, predicate.Funcs{
GenericFunc: func(genericEvent event.GenericEvent) bool {
if genericEvent.Object == nil {
return false
}
return genericEvent.Object.GetName() == "cloud-credential"
if err := c.Watch(source.Kind(operatorCache, &configv1.ClusterOperator{}), handler.EnqueueRequestsFromMapFunc(alwaysReconcileCCOConfigObject), predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool {
return e.Object != nil && e.Object.GetName() == constants.CloudCredClusterOperatorName
},
UpdateFunc: func(e event.UpdateEvent) bool {
return e.ObjectNew != nil && e.ObjectNew.GetName() == constants.CloudCredClusterOperatorName
},
DeleteFunc: func(e event.DeleteEvent) bool {
return e.Object != nil && e.Object.GetName() == constants.CloudCredClusterOperatorName
},
}); err != nil {
return err
Expand Down

0 comments on commit a24c87e

Please sign in to comment.