code: func (f *HostPortFilter) SetTask(t *api.Task) bool {
  	if t.Endpoint != nil {
  		for _, port := range t.Endpoint.Ports {
  			if port.PublishMode == api.PublishModeHost && port.PublishedPort != 0 {
  				f.t = t
  				return true
  			}
  		}
  	}
  
  	return false
  }
docs: // SetTask returns true when the filter is enabled for a given task.