Add filter task by running status in marathon

This commit is contained in:
emile 2015-11-22 23:32:31 +01:00
parent 4e9ff45747
commit 8fdd0b20d1
3 changed files with 9 additions and 4 deletions

View file

@ -23,7 +23,7 @@ type Marathon struct {
type lightMarathonClient interface {
Applications(url.Values) (*marathon.Applications, error)
AllTasks() (*marathon.Tasks, error)
AllTasks(v url.Values) (*marathon.Tasks, error)
}
// Provide allows the provider to provide configurations to traefik
@ -85,7 +85,7 @@ func (provider *Marathon) loadMarathonConfig() *types.Configuration {
return nil
}
tasks, err := provider.marathonClient.AllTasks()
tasks, err := provider.marathonClient.AllTasks((url.Values{"status": []string{"running"}}))
if err != nil {
log.Errorf("Failed to create a client for marathon, error: %s", err)
return nil