func PickMost(c *ControlPlane, machines FilterableMachineCollection) *string {
	fds := orderDescending(c.Cluster.Status.FailureDomains.FilterControlPlane(), c.Machines)
	for _, fd := range fds {
		for _, m := range machines {
			if m.Spec.FailureDomain == nil {
				continue
			}
			if *m.Spec.FailureDomain == fd.id {
				return &fd.id
			}
		}
	}
	return nil
}
PickMost returns a failure domain that is in machines and has most control-plane machines on.
package k3s
import (
	"sort"
	"k8s.io/klog/klogr"
	"k8s.io/utils/pointer"
	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
)
var Log = klogr.New()
type failureDomainAggregation struct {
	id    string
	count int
}
type failureDomainAggregations []failureDomainAggregation
func (f failureDomainAggregations) Len() int {
	return len(f)
}
func (f failureDomainAggregations) Less(i, j int) bool {
	return f[i].count < f[j].count
}
func (f failureDomainAggregations) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}