code: func ValidateCustomResourceDefinitionStoredVersions(storedVersions []string, versions []apiextensions.CustomResourceDefinitionVersion, fldPath *field.Path) field.ErrorList {
  	if len(storedVersions) == 0 {
  		return field.ErrorList{field.Invalid(fldPath, storedVersions, "must have at least one stored version")}
  	}
  	allErrs := field.ErrorList{}
  	storedVersionsMap := map[string]int{}
  	for i, v := range storedVersions {
  		storedVersionsMap[v] = i
  	}
  	for _, v := range versions {
  		_, ok := storedVersionsMap[v.Name]
  		if v.Storage && !ok {
  			allErrs = append(allErrs, field.Invalid(fldPath, v, "must have the storage version "+v.Name))
  		}
  		if ok {
  			delete(storedVersionsMap, v.Name)
  		}
  	}
  
  	for v, i := range storedVersionsMap {
  		allErrs = append(allErrs, field.Invalid(fldPath.Index(i), v, "must appear in spec.versions"))
  	}
  
  	return allErrs
  }
docs: // ValidateCustomResourceDefinitionStoredVersions statically validates