Skip to content

Commit c2f123a

Browse files
committed
1
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent 13de063 commit c2f123a

File tree

1 file changed

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

1 file changed

+7
-16
lines changed

components/node-labeler/cmd/run.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,20 @@ var runCmd = &cobra.Command{
8080
client,
8181
}
8282

83-
rfPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
84-
MatchLabels: map[string]string{
85-
"app": "gitpod",
86-
"component": "registry-facade",
87-
},
88-
})
89-
if err != nil {
90-
log.WithError(err).Fatal("unable to create predicate")
91-
}
92-
93-
wsPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
94-
MatchLabels: map[string]string{
95-
"app": "gitpod",
96-
"component": "ws-daemon",
97-
},
83+
componentPredicate, err := predicate.LabelSelectorPredicate(metav1.LabelSelector{
84+
MatchExpressions: []metav1.LabelSelectorRequirement{{
85+
Key: "component",
86+
Operator: metav1.LabelSelectorOpIn,
87+
Values: []string{"ws-daemon", "registry-facade"},
88+
}},
9889
})
9990
if err != nil {
10091
log.WithError(err).Fatal("unable to create predicate")
10192
}
10293

10394
err = ctrl.NewControllerManagedBy(mgr).
10495
Named("pod-watcher").
105-
For(&corev1.Pod{}, builder.WithPredicates(predicate.Or(rfPredicate, wsPredicate))).
96+
For(&corev1.Pod{}, builder.WithPredicates(predicate.Or(componentPredicate))).
10697
WithOptions(controller.Options{MaxConcurrentReconciles: 1}).
10798
Complete(r)
10899
if err != nil {

0 commit comments

Comments
 (0)