Skip to content

Commit 049bfe8

Browse files
iQQBotkylos101
andauthored
Apply suggestions from code review
Co-authored-by: Kyle Brennan <[email protected]>
1 parent 1d07810 commit 049bfe8

File tree

1 file changed

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

1 file changed

+7
-3
lines changed

components/node-labeler/cmd/run.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
237237

238238
healthy, err := checkPodHealth(pod)
239239
if err != nil {
240-
log.WithError(err).Error("checking pod health")
240+
log.WithError(err).Error("cannot check pod health")
241241
return reconcile.Result{RequeueAfter: defaultRequeueTime}, nil
242242
}
243243

244244
var node corev1.Node
245245
err = r.Get(ctx, types.NamespacedName{Name: nodeName}, &node)
246246
if err != nil {
247247
if !errors.IsNotFound(err) {
248-
log.WithError(err).Error("obtaining node")
248+
log.WithError(err).Error("cannot get node")
249249
}
250250
return reconcile.Result{}, client.IgnoreNotFound(err)
251251
}
@@ -257,7 +257,11 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
257257

258258
err = updateNodeTaint(taintKey, !healthy, nodeName, r)
259259
if err != nil {
260-
log.WithError(err).Error("updating node taint")
260+
log.WithError(err).
261+
WithField("taintKey", taintKey).
262+
WithField("add", !healthy).
263+
WithField("nodeName", nodeName).
264+
Error("cannot update node taint")
261265
return reconcile.Result{RequeueAfter: defaultRequeueTime}, nil
262266
}
263267

0 commit comments

Comments
 (0)