code: func ValidateNetworkPolicy(np *networking.NetworkPolicy) field.ErrorList {
  	allErrs := apivalidation.ValidateObjectMeta(&np.ObjectMeta, true, ValidateNetworkPolicyName, field.NewPath("metadata"))
  	allErrs = append(allErrs, ValidateNetworkPolicySpec(&np.Spec, field.NewPath("spec"))...)
  	return allErrs
  }
docs: // ValidateNetworkPolicy validates a networkpolicy.