Skip to content

Commit 14dfb3e

Browse files
committed
Improve node-labeler logs
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent db756b3 commit 14dfb3e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/node-labeler/cmd/podutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package cmd
77
import corev1 "k8s.io/api/core/v1"
88

99
// IsPodReady returns true if a pod is ready; false otherwise.
10-
func IsPodReady(pod *corev1.Pod) bool {
10+
func IsPodReady(pod corev1.Pod) bool {
1111
return IsPodReadyConditionTrue(pod.Status)
1212
}
1313

components/node-labeler/cmd/run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ type PodReconciler struct {
137137
}
138138

139139
func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
140+
log.WithField("pod", req.Name).Info("reconciling...")
141+
140142
var pod corev1.Pod
141143
err := r.Get(ctx, req.NamespacedName, &pod)
142144
if err != nil {
@@ -194,7 +196,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
194196
return reconcile.Result{}, err
195197
}
196198

197-
if !IsPodReady(&pod) {
199+
if !IsPodReady(pod) {
198200
// not ready. Wait until the next update.
199201
return reconcile.Result{}, nil
200202
}

0 commit comments

Comments
 (0)