code: func (f *HostPortFilter) Check(n *NodeInfo) bool {
  	for _, port := range f.t.Endpoint.Ports {
  		if port.PublishMode == api.PublishModeHost && port.PublishedPort != 0 {
  			portSpec := hostPortSpec{protocol: port.Protocol, publishedPort: port.PublishedPort}
  			if _, ok := n.usedHostPorts[portSpec]; ok {
  				return false
  			}
  		}
  	}
  
  	return true
  }
docs: // Check returns true if the task can be scheduled into the given node.