File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ func UpdateBackends(config *util.Config) (map[string][]util.Backend, error) {
31
31
}
32
32
33
33
var indexedApps = indexApps (apps )
34
- var indexedTasks = indexTasks (tasks )
34
+ var indexedTasks = indexHealthyTasks (tasks )
35
35
var labelPrefix = config .Marathon .LabelPrefix + ".port."
36
36
37
37
for appId , app := range indexedApps {
@@ -187,14 +187,17 @@ func indexApps(apps Apps) (indexedApps map[string]App) {
187
187
return indexedApps
188
188
}
189
189
190
- func indexTasks (tasks Tasks ) (indexedTasks map [string ][]Task ) {
190
+ func indexHealthyTasks (tasks Tasks ) (indexedTasks map [string ][]Task ) {
191
191
indexedTasks = make (map [string ][]Task )
192
192
193
193
for _ , task := range tasks .Tasks {
194
194
if indexedTasks [task .Id ] == nil {
195
195
indexedTasks [task .Id ] = []Task {}
196
196
}
197
- indexedTasks [task .AppId ] = append (indexedTasks [task .AppId ], task )
197
+ // Skip non healthy Tasks
198
+ if len (task .HealthCheckResults ) > 0 && task .HealthCheckResults [0 ].Alive {
199
+ indexedTasks [task .AppId ] = append (indexedTasks [task .AppId ], task )
200
+ }
198
201
}
199
202
return indexedTasks
200
203
}
You can’t perform that action at this time.
0 commit comments