code: func IsIngressNetworkNeeded(s *api.Service) bool {
  	if s == nil {
  		return false
  	}
  
  	if s.Spec.Endpoint == nil {
  		return false
  	}
  
  	for _, p := range s.Spec.Endpoint.Ports {
  		// The service to which this task belongs is trying to
  		// expose ports with PublishMode as Ingress to the
  		// external world. Automatically attach the task to
  		// the ingress network.
  		if p.PublishMode == api.PublishModeIngress {
  			return true
  		}
  	}
  
  	return false
  }
docs: // IsIngressNetworkNeeded checks whether the service requires the routing-mesh