Skip to content

Commit e381293

Browse files
authored
Correct resource label for caching and use GenerationChangedPredicate for OperandRequest reconciliation triggering (#1180)
* Update BindInfoRefreshLabel value to 'enabled' in cache configuration Signed-off-by: Daniel Fan <[email protected]> * Replace ResourceVersionChangedPredicate with GenerationChangedPredicate in OperandRequest controller setup Signed-off-by: Daniel Fan <[email protected]> --------- Signed-off-by: Daniel Fan <[email protected]>
1 parent 315edda commit e381293

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

controllers/k8sutil/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewODLMCache(isolatedModeEnable bool, opts ctrl.Options) ctrl.Options {
3737
labels.Set{constant.ODLMWatchedLabel: "true"},
3838
)
3939
cacheFreshLabelSelector := labels.SelectorFromSet(
40-
labels.Set{constant.BindInfoRefreshLabel: "true"},
40+
labels.Set{constant.BindInfoRefreshLabel: "enabled"},
4141
)
4242

4343
watchNamespace := util.GetWatchNamespace()

controllers/operandrequest/operandrequest_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
406406
}
407407
return ctrl.NewControllerManagedBy(mgr).
408408
WithOptions(options).
409-
For(&operatorv1alpha1.OperandRequest{}, builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
409+
For(&operatorv1alpha1.OperandRequest{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
410410
Watches(&olmv1alpha1.Subscription{}, handler.EnqueueRequestsFromMapFunc(r.getSubToRequestMapper), builder.WithPredicates(predicate.Funcs{
411411
UpdateFunc: func(e event.UpdateEvent) bool {
412412
oldObject := e.ObjectOld.(*olmv1alpha1.Subscription)

controllers/operandrequestnoolm/operandrequestnoolm_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
351351
}
352352
return ctrl.NewControllerManagedBy(mgr).
353353
WithOptions(options).
354-
For(&operatorv1alpha1.OperandRequest{}, builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
354+
For(&operatorv1alpha1.OperandRequest{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
355355
Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.getReferenceToRequestMapper), builder.WithPredicates(predicate.Funcs{
356356
UpdateFunc: func(e event.UpdateEvent) bool {
357357
oldObject := e.ObjectOld.(*corev1.ConfigMap)

0 commit comments

Comments
 (0)