code: func validateAllowedTopologies(topologies []api.TopologySelectorTerm, fldPath *field.Path) field.ErrorList {
  	allErrs := field.ErrorList{}
  
  	if topologies == nil || len(topologies) == 0 {
  		return allErrs
  	}
  
  	rawTopologies := make([]map[string]sets.String, len(topologies))
  	for i, term := range topologies {
  		idxPath := fldPath.Index(i)
  		exprMap, termErrs := apivalidation.ValidateTopologySelectorTerm(term, fldPath.Index(i))
  		allErrs = append(allErrs, termErrs...)
  
  		// TODO (verult) consider improving runtime
  		for _, t := range rawTopologies {
  			if helper.Semantic.DeepEqual(exprMap, t) {
  				allErrs = append(allErrs, field.Duplicate(idxPath.Child("matchLabelExpressions"), ""))
  			}
  		}
  
  		rawTopologies = append(rawTopologies, exprMap)
  	}
  
  	return allErrs
  }
docs: // validateAllowedTopology tests that AllowedTopologies specifies valid values.