diff --git a/config/config.go b/config/config.go index d8ad57f3..b197af3b 100644 --- a/config/config.go +++ b/config/config.go @@ -160,6 +160,8 @@ func (c *Config) LoadDefaults(ctx context.Context) *gerr.GatewayDError { CertFile: "", KeyFile: "", HandshakeTimeout: DefaultHandshakeTimeout, + Proxies: []string{Default}, + LoadBalancer: LoadBalancer{Strategy: DefaultLoadBalancerStrategy}, } c.globalDefaults = GlobalConfig{ @@ -413,7 +415,7 @@ func (c *Config) ValidateGlobalConfig(ctx context.Context) *gerr.GatewayDError { } var errors []*gerr.GatewayDError - configObjects := []string{"loggers", "metrics", "clients", "pools", "proxies", "servers"} + configObjects := []string{"loggers", "metrics", "servers"} sort.Strings(configObjects) var seenConfigObjects []string diff --git a/config/constants.go b/config/constants.go index 4591de2c..83d9dca4 100644 --- a/config/constants.go +++ b/config/constants.go @@ -89,10 +89,11 @@ const ( DefaultHealthCheckPeriod = 60 * time.Second // This must match PostgreSQL authentication timeout. // Server constants. - DefaultListenNetwork = "tcp" - DefaultListenAddress = "0.0.0.0:15432" - DefaultTickInterval = 5 * time.Second - DefaultHandshakeTimeout = 5 * time.Second + DefaultListenNetwork = "tcp" + DefaultListenAddress = "0.0.0.0:15432" + DefaultTickInterval = 5 * time.Second + DefaultHandshakeTimeout = 5 * time.Second + DefaultLoadBalancerStrategy = "ROUND_ROBIN" // Utility constants. DefaultSeed = 1000 diff --git a/network/server_test.go b/network/server_test.go index 5c5293ac..94645208 100644 --- a/network/server_test.go +++ b/network/server_test.go @@ -114,11 +114,12 @@ func TestRunServer(t *testing.T) { Options: Option{ EnableTicker: true, }, - Proxies: []IProxy{proxy}, - Logger: logger, - PluginRegistry: pluginRegistry, - PluginTimeout: config.DefaultPluginTimeout, - HandshakeTimeout: config.DefaultHandshakeTimeout, + Proxies: []IProxy{proxy}, + Logger: logger, + PluginRegistry: pluginRegistry, + PluginTimeout: config.DefaultPluginTimeout, + HandshakeTimeout: config.DefaultHandshakeTimeout, + LoadbalancerStrategyName: RoundRobinStrategy, }, ) assert.NotNil(t, server)