in controllers/scale.go [39:47]
func (r *EtcdadmClusterReconciler) scaleDownEtcdCluster(ctx context.Context, ec *etcdv1.EtcdadmCluster, cluster *clusterv1.Cluster, ep *EtcdPlane, outdatedMachines collections.Machines) (ctrl.Result, error) {
// Pick the Machine that we should scale down.
machineToDelete, err := selectMachineForScaleDown(ep, outdatedMachines)
if err != nil || machineToDelete == nil {
return ctrl.Result{}, errors.Wrap(err, "failed to select machine for scale down")
}
machineAddress := getEtcdMachineAddress(machineToDelete)
return ctrl.Result{}, r.removeEtcdMachine(ctx, ec, cluster, machineToDelete, machineAddress)
}