Skip to content

Commit 5f12704

Browse files
committed
1
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent 876e8e4 commit 5f12704

File tree

1 file changed

+8
-1
lines changed
  • components/node-labeler/cmd

1 file changed

+8
-1
lines changed

components/node-labeler/cmd/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ import (
2929
"sigs.k8s.io/controller-runtime/pkg/builder"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
3131
"sigs.k8s.io/controller-runtime/pkg/controller"
32+
"sigs.k8s.io/controller-runtime/pkg/handler"
3233
"sigs.k8s.io/controller-runtime/pkg/healthz"
3334
"sigs.k8s.io/controller-runtime/pkg/metrics"
3435
"sigs.k8s.io/controller-runtime/pkg/predicate"
3536
"sigs.k8s.io/controller-runtime/pkg/reconcile"
37+
"sigs.k8s.io/controller-runtime/pkg/source"
3638

3739
"github.com/gitpod-io/gitpod/common-go/log"
3840
)
@@ -84,7 +86,12 @@ var runCmd = &cobra.Command{
8486

8587
err = ctrl.NewControllerManagedBy(mgr).
8688
Named("pod-watcher").
87-
For(&corev1.Pod{}, builder.WithPredicates(filterPredicate)).
89+
For(&corev1.Pod{}).
90+
Watches(
91+
&source.Kind{Type: &corev1.Pod{}},
92+
&handler.EnqueueRequestForObject{},
93+
builder.WithPredicates(filterPredicate),
94+
).
8895
WithOptions(controller.Options{
8996
MaxConcurrentReconciles: 20,
9097
}).

0 commit comments

Comments
 (0)