diff --git a/server/server.go b/server/server.go index e1465db2c..ad7b64876 100644 --- a/server/server.go +++ b/server/server.go @@ -255,7 +255,7 @@ func (server *Server) defaultConfigurationValues(configuration *types.Configurat return } server.configureFrontends(configuration.Frontends) - configureBackends(configuration.Backends) + server.configureBackends(configuration.Backends) } func (server *Server) listenConfigurations(stop chan bool) { @@ -889,7 +889,7 @@ func (server *Server) configureFrontends(frontends map[string]*types.Frontend) { } } -func configureBackends(backends map[string]*types.Backend) { +func (*Server) configureBackends(backends map[string]*types.Backend) { for backendName, backend := range backends { _, err := types.NewLoadBalancerMethod(backend.LoadBalancer) if err != nil { diff --git a/server/server_test.go b/server/server_test.go index 9c4d6bdf9..cb4c2d6d9 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -341,7 +341,8 @@ func TestConfigureBackends(t *testing.T) { LoadBalancer: test.lb, } - configureBackends(map[string]*types.Backend{ + srv := Server{} + srv.configureBackends(map[string]*types.Backend{ "backend": backend, })