code: func toExternalServiceOrError(obj runtime.Object) (*corev1.Service, error) {
  	svc := &corev1.Service{}
  	switch t := obj.(type) {
  	case *corev1.Service:
  		svc = t
  	case *api.Service:
  		if err := k8s_api_v1.Convert_core_Service_To_v1_Service(t, svc, nil); err != nil {
  			return nil, err
  		}
  	default:
  		return nil, fmt.Errorf("expect *api.Service or *v1.Service, got %v", t)
  	}
  	return svc, nil
  }
docs: // convert the input object to an internal service object or error.