code: func ValidateStatefulSet(statefulSet *apps.StatefulSet) field.ErrorList {
  	allErrs := apivalidation.ValidateObjectMeta(&statefulSet.ObjectMeta, true, ValidateStatefulSetName, field.NewPath("metadata"))
  	allErrs = append(allErrs, ValidateStatefulSetSpec(&statefulSet.Spec, field.NewPath("spec"))...)
  	return allErrs
  }
docs: // ValidateStatefulSet validates a StatefulSet.