@@ -78,9 +78,20 @@ var runCmd = &cobra.Command{
78
78
client ,
79
79
}
80
80
81
- filterPredicate , err := predicate .LabelSelectorPredicate (metav1.LabelSelector {
81
+ rfPredicate , err := predicate .LabelSelectorPredicate (metav1.LabelSelector {
82
82
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" ,
84
95
},
85
96
})
86
97
if err != nil {
@@ -89,7 +100,7 @@ var runCmd = &cobra.Command{
89
100
90
101
err = ctrl .NewControllerManagedBy (mgr ).
91
102
Named ("pod-watcher" ).
92
- For (& corev1.Pod {}, builder .WithPredicates (filterPredicate )).
103
+ For (& corev1.Pod {}, builder .WithPredicates (predicate . Or ( rfPredicate , wsPredicate ) )).
93
104
WithOptions (controller.Options {MaxConcurrentReconciles : 1 }).
94
105
Complete (r )
95
106
if err != nil {
@@ -133,6 +144,8 @@ type PodReconciler struct {
133
144
}
134
145
135
146
func (r * PodReconciler ) Reconcile (ctx context.Context , req reconcile.Request ) (reconcile.Result , error ) {
147
+ log .WithField ("pod" , req .Name ).Info ("reconciling" )
148
+
136
149
var pod corev1.Pod
137
150
err := r .Get (ctx , req .NamespacedName , & pod )
138
151
if err != nil {
0 commit comments