Skip to content

Commit 089fda1

Browse files
authored
fix: controller to reconcile on label changes (#103)
- Fixes an issue where label changes do not trigger reconciliation. --------- Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
1 parent c3af0f8 commit 089fda1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/controller/mcpserver_controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ func (r *MCPServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
102102
// SetupWithManager sets up the controller with the Manager.
103103
func (r *MCPServerReconciler) SetupWithManager(mgr ctrl.Manager) error {
104104
return ctrl.NewControllerManagedBy(mgr).
105-
For(&kagentdevv1alpha1.MCPServer{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
105+
For(&kagentdevv1alpha1.MCPServer{}, builder.WithPredicates(
106+
predicate.Or(
107+
predicate.GenerationChangedPredicate{},
108+
predicate.LabelChangedPredicate{},
109+
),
110+
)).
106111
Owns(&appsv1.Deployment{}, builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
107112
Owns(&corev1.Service{}, builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
108113
Owns(&corev1.ConfigMap{}, builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).

0 commit comments

Comments
 (0)