code: func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
  	allErrs := field.ErrorList{}
  	var totalSize int64
  	for k, v := range annotations {
  		if !validation.IsQualifiedName(strings.ToLower(k)) {
  			allErrs = append(allErrs, field.Invalid(fldPath, k, qualifiedNameErrorMsg))
  		}
  		totalSize += (int64)(len(k)) + (int64)(len(v))
  	}
  	if totalSize > (int64)(totalAnnotationSizeLimitB) {
  		allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB))
  	}
  
  	if annotations[api.AffinityAnnotationKey] != "" {
  		allErrs = append(allErrs, ValidateAffinityInPodAnnotations(annotations, fldPath)...)
  	}
  	return allErrs
  }
docs: // ValidateAnnotations validates that a set of annotations are correctly defined.