Add filter task by running status in marathon
This commit is contained in:
parent
4e9ff45747
commit
8fdd0b20d1
3 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -24,7 +24,7 @@ func (c *fakeClient) Applications(url.Values) (*marathon.Applications, error) {
|
|||
return c.applications, nil
|
||||
}
|
||||
|
||||
func (c *fakeClient) AllTasks() (*marathon.Tasks, error) {
|
||||
func (c *fakeClient) AllTasks(v url.Values) (*marathon.Tasks, error) {
|
||||
if c.tasksError {
|
||||
return nil, errors.New("error")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue