code: func validateResourceQuotaScopes(resourceQuotaSpec *core.ResourceQuotaSpec, fld *field.Path) field.ErrorList {
  	allErrs := field.ErrorList{}
  	if len(resourceQuotaSpec.Scopes) == 0 {
  		return allErrs
  	}
  	hardLimits := sets.NewString()
  	for k := range resourceQuotaSpec.Hard {
  		hardLimits.Insert(string(k))
  	}
  	fldPath := fld.Child("scopes")
  	scopeSet := sets.NewString()
  	for _, scope := range resourceQuotaSpec.Scopes {
  		if !helper.IsStandardResourceQuotaScope(string(scope)) {
  			allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope"))
  		}
  		for _, k := range hardLimits.List() {
  			if helper.IsStandardQuotaResourceName(k) && !helper.IsResourceQuotaScopeValidForResource(scope, k) {
  				allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope applied to resource"))
  			}
  		}
  		scopeSet.Insert(string(scope))
  	}
  	invalidScopePairs := []sets.String{
  		sets.NewString(string(core.ResourceQuotaScopeBestEffort), string(core.ResourceQuotaScopeNotBestEffort)),
  		sets.NewString(string(core.ResourceQuotaScopeTerminating), string(core.ResourceQuotaScopeNotTerminating)),
  	}
  	for _, invalidScopePair := range invalidScopePairs {
  		if scopeSet.HasAll(invalidScopePair.List()...) {
  			allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "conflicting scopes"))
  		}
  	}
  	return allErrs
  }
docs: // validateResourceQuotaScopes ensures that each enumerated hard resource constraint is valid for set of scopes