Skip to content

Commit 63c8081

Browse files
committed
1
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent 14dfb3e commit 63c8081

File tree

1 file changed

+5
-0
lines changed
  • components/node-labeler/cmd

1 file changed

+5
-0
lines changed

components/node-labeler/cmd/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ type PodReconciler struct {
138138

139139
func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
140140
log.WithField("pod", req.Name).Info("reconciling...")
141+
startTime := time.Now()
142+
defer func() {
143+
log.WithField("pod", req.Name).Infof("reconciling took %vs", time.Since(startTime).Seconds())
144+
}()
141145

142146
var pod corev1.Pod
143147
err := r.Get(ctx, req.NamespacedName, &pod)
@@ -209,6 +213,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
209213

210214
if labelValue, exists := node.Labels[labelToUpdate]; exists && labelValue == "true" {
211215
// nothing to do, the label already exists.
216+
log.WithField("node", node.Name).WithField("label", labelToUpdate).Info("label already exists")
212217
return reconcile.Result{}, nil
213218
}
214219

0 commit comments

Comments
 (0)