Skip to content

Commit 7ca573b

Browse files
authored
Merge pull request #11823 from linsite/cluster-controller-update-log-message
🌱 Improve waiting for CP / InfraCluster deletion logs
2 parents 78c4806 + 4492185 commit 7ca573b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/controllers/cluster/cluster_controller.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,9 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, s *scope) (reconcile.R
454454
s.deletingReason = clusterv1.ClusterDeletingWaitingForControlPlaneDeletionV1Beta2Reason
455455
s.deletingMessage = fmt.Sprintf("Waiting for %s to be deleted", cluster.Spec.ControlPlaneRef.Kind)
456456

457-
log.Info("Cluster still has descendants - need to requeue", "controlPlaneRef", cluster.Spec.ControlPlaneRef.Name)
457+
// We are watching it, will try again when it is deleted.
458+
ref := cluster.Spec.ControlPlaneRef
459+
log.Info("Cluster still has descendants - waiting for control plane deletion", ref.Kind, klog.KRef(ref.Namespace, ref.Name))
458460
return ctrl.Result{}, nil
459461
}
460462
}
@@ -492,7 +494,9 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, s *scope) (reconcile.R
492494
s.deletingReason = clusterv1.ClusterDeletingWaitingForInfrastructureDeletionV1Beta2Reason
493495
s.deletingMessage = fmt.Sprintf("Waiting for %s to be deleted", cluster.Spec.InfrastructureRef.Kind)
494496

495-
log.Info("Cluster still has descendants - need to requeue", "infrastructureRef", cluster.Spec.InfrastructureRef.Name)
497+
// We are watching it, will try again when it is deleted.
498+
ref := cluster.Spec.InfrastructureRef
499+
log.Info("Cluster still has descendants - waiting for infrastructure cluster deletion", ref.Kind, klog.KRef(ref.Namespace, ref.Name))
496500
return ctrl.Result{}, nil
497501
}
498502
}

0 commit comments

Comments
 (0)