Skip to content

Commit 441a749

Browse files
committed
1
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent 000da2a commit 441a749

File tree

1 file changed

+16
-3
lines changed
  • components/node-labeler/cmd

1 file changed

+16
-3
lines changed

components/node-labeler/cmd/run.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,20 @@ var runCmd = &cobra.Command{
7878
client,
7979
}
8080

81-
filterPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
81+
rfPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
8282
MatchLabels: map[string]string{
83-
"required-by-node-labeler": "true",
83+
"app": "gitpod",
84+
"component": "registry-facade",
85+
},
86+
})
87+
if err != nil {
88+
log.WithError(err).Fatal("unable to create predicate")
89+
}
90+
91+
wsPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
92+
MatchLabels: map[string]string{
93+
"app": "gitpod",
94+
"component": "ws-daemon",
8495
},
8596
})
8697
if err != nil {
@@ -89,7 +100,7 @@ var runCmd = &cobra.Command{
89100

90101
err = ctrl.NewControllerManagedBy(mgr).
91102
Named("pod-watcher").
92-
For(&corev1.Pod{}, builder.WithPredicates(filterPredicate)).
103+
For(&corev1.Pod{}, builder.WithPredicates(predicate.Or(rfPredicate, wsPredicate))).
93104
WithOptions(controller.Options{MaxConcurrentReconciles: 1}).
94105
Complete(r)
95106
if err != nil {
@@ -133,6 +144,8 @@ type PodReconciler struct {
133144
}
134145

135146
func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
147+
log.WithField("pod", req.Name).Info("reconciling")
148+
136149
var pod corev1.Pod
137150
err := r.Get(ctx, req.NamespacedName, &pod)
138151
if err != nil {

0 commit comments

Comments
 (0)