code: func ValidateConfigMap(cfg *extensions.ConfigMap) field.ErrorList {
  	allErrs := field.ErrorList{}
  	allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&cfg.ObjectMeta, true, ValidateConfigMapName, field.NewPath("metadata"))...)
  
  	for key := range cfg.Data {
  		if !apivalidation.IsSecretKey(key) {
  			allErrs = append(allErrs, field.Invalid(field.NewPath("data").Key(key), key, fmt.Sprintf("must have at most %d characters and match regex %s", validation.DNS1123SubdomainMaxLength, apivalidation.SecretKeyFmt)))
  		}
  	}
  
  	return allErrs
  }
docs: // ValidateConfigMap tests whether required fields in the ConfigMap are set.