code: func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList {
  	metadata, err := meta.Accessor(objMeta)
  	if err != nil {
  		allErrs := field.ErrorList{}
  		allErrs = append(allErrs, field.Invalid(fldPath, objMeta, err.Error()))
  		return allErrs
  	}
  	return ValidateObjectMetaAccessor(metadata, requiresNamespace, nameFn, fldPath)
  }
docs: // ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already
  // been performed.
  // It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before.