From 02035d4942c9da9db393739879e66c28d872ce44 Mon Sep 17 00:00:00 2001 From: Alex Antonov Date: Wed, 1 Nov 2017 05:26:03 -0500 Subject: [PATCH] Missing Backend key in configuration when application has no tasks --- provider/marathon/marathon_test.go | 4 +++- templates/marathon.tmpl | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/marathon/marathon_test.go b/provider/marathon/marathon_test.go index 4c58ab62e..f7ea244af 100644 --- a/provider/marathon/marathon_test.go +++ b/provider/marathon/marathon_test.go @@ -93,7 +93,9 @@ func TestMarathonLoadConfigNonAPIErrors(t *testing.T) { }, }, }, - expectedBackends: nil, + expectedBackends: map[string]*types.Backend{ + "backend-app": {}, + }, }, { desc: "load balancer / circuit breaker labels", diff --git a/templates/marathon.tmpl b/templates/marathon.tmpl index e03fd601c..4f342f02c 100644 --- a/templates/marathon.tmpl +++ b/templates/marathon.tmpl @@ -12,6 +12,7 @@ {{range $app := $apps}} {{range $serviceIndex, $serviceName := getServiceNames $app}} +[backends."backend{{getBackend $app $serviceName }}"] {{ if hasMaxConnLabels $app }} [backends."backend{{getBackend $app $serviceName }}".maxconn] amount = {{getMaxConnAmount $app }}