Skip to content

Commit 6fcaff9

Browse files
committed
improve logging during Machine deletion
1 parent 9c5fdae commit 6fcaff9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/controllers/machine/machine_controller.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, cluster *clusterv1.Clu
368368
// After node draining is completed, and if isNodeVolumeDetachingAllowed returns True, make sure all
369369
// volumes are detached before proceeding to delete the Node.
370370
if r.isNodeVolumeDetachingAllowed(m) {
371-
log.Info("Waiting for node volumes to be detached", "Node", klog.KRef("", m.Status.NodeRef.Name))
372-
373371
// The VolumeDetachSucceededCondition never exists before we wait for volume detachment for the first time,
374372
// so its transition time can be used to record the first time we wait for volume detachment.
375373
// This `if` condition prevents the transition time to be changed more than once.
@@ -412,10 +410,16 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, cluster *clusterv1.Clu
412410
}
413411

414412
if ok, err := r.reconcileDeleteInfrastructure(ctx, m); !ok || err != nil {
413+
if err == nil {
414+
log.Info("Waiting for infrastructure to be deleted", "Infrastructure", klog.KRef("", m.Spec.InfrastructureRef.Name))
415+
}
415416
return ctrl.Result{}, err
416417
}
417418

418419
if ok, err := r.reconcileDeleteBootstrap(ctx, m); !ok || err != nil {
420+
if err == nil {
421+
log.Info("Waiting for bootstrap to be deleted", "Bootstrap", klog.KRef("", m.Spec.Bootstrap.ConfigRef.Name))
422+
}
419423
return ctrl.Result{}, err
420424
}
421425

0 commit comments

Comments
 (0)