// We need at least one master.
We need at least one master.
// We need at least one master .
func validateAtLeastOneMaster(machines []*clusterv1.Machine) field.ErrorList {
	numMasters := 0
	for _, m := range machines {
		if IsMaster(m) {
			numMasters++
		}
	}
	if numMasters == 0 {
		return field.ErrorList{
			field.Invalid(
				field.NewPath("spec", "versions", "controlPlane"),
				machines[0].Spec.Versions.ControlPlane,
				"no master node defined, need at least one master"),
		}
	}
	return field.ErrorList{}
}
func validateAtLeastOneMaster ( machines [ ] * clusterv1 . Machine ) field . ErrorList { numMasters := 0 for _ , m := range machines { if IsMaster ( m ) { numMasters ++ } } if numMasters == 0 { return field . ErrorList { field . Invalid ( field . NewPath ( " " , " " , " " ) , machines [ 0 ] . Spec . Versions . ControlPlane , " " ) , } } return field . ErrorList { } }
We need at least one master.
We need at least one master .