File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
components/node-labeler/cmd Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ var runCmd = &cobra.Command{
72
72
client ,
73
73
}
74
74
75
- c , err := controller .New ("pod-watcher" , mgr , controller.Options {Reconciler : r })
75
+ c , err := controller .New ("pod-watcher" , mgr , controller.Options {
76
+ Reconciler : r ,
77
+ MaxConcurrentReconciles : 20 ,
78
+ })
76
79
if err != nil {
77
80
log .WithError (err ).Fatal ("unable to bind controller watch event handler" )
78
81
}
@@ -188,6 +191,12 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
188
191
time .Sleep (1 * time .Second )
189
192
err := updateLabel (labelToUpdate , false , nodeName , r )
190
193
if err != nil {
194
+ // this is a edge case when cluster-autoscaler removes a node
195
+ // (all the running pods will be removed after that)
196
+ if errors .IsNotFound (err ) {
197
+ return reconcile.Result {}, nil
198
+ }
199
+
191
200
log .WithError (err ).Error ("unexpected error removing node label" )
192
201
return reconcile.Result {RequeueAfter : time .Second * 10 }, err
193
202
}
You can’t perform that action at this time.
0 commit comments