diff --git a/provider/marathon.go b/provider/marathon.go index 046767c33..3cd50a1f1 100644 --- a/provider/marathon.go +++ b/provider/marathon.go @@ -264,6 +264,9 @@ func (provider *Marathon) taskFilter(task marathon.Task, applications *marathon. return false } } + } else { + log.Debugf("Filtering marathon task %s with defined healthcheck as no healthcheck has run yet", task.AppID) + return false } } return true diff --git a/provider/marathon_test.go b/provider/marathon_test.go index 5ed916aa5..3166ae19e 100644 --- a/provider/marathon_test.go +++ b/provider/marathon_test.go @@ -629,7 +629,7 @@ func TestMarathonTaskFilter(t *testing.T) { }, }, }, - expected: true, + expected: false, exposedByDefault: true, }, {