Skip to content

Commit 5406b0f

Browse files
authored
Do not return an error with discovery strategy and failover (#951)
Do not return an error when discovery strategy and failover are configured together
1 parent 72150b1 commit 5406b0f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cluster/discovery_config.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ package cluster
1919
import "github.com/hazelcast/hazelcast-go-client/cluster/discovery"
2020

2121
type DiscoveryConfig struct {
22-
Strategy discovery.Strategy `json:",omitempty"`
23-
UsePublicIP bool `json:",omitempty"`
22+
// Strategy is a discovery.Strategy implementation.
23+
// See the documentation in the discovery package.
24+
Strategy discovery.Strategy `json:",omitempty"`
25+
// UsePublicIP causes the client to use the public addresses of members instead of their private addresses, if available.
26+
UsePublicIP bool `json:",omitempty"`
2427
}
2528

2629
func (c DiscoveryConfig) Clone() DiscoveryConfig {

cluster/failover_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ func sanitizedConfig(c Config) Config {
145145
c.Network.Addresses = nil
146146
c.Cloud = CloudConfig{}
147147
c.ConnectionStrategy = ConnectionStrategyConfig{}
148+
c.Discovery.Strategy = nil
149+
c.Discovery.UsePublicIP = false
148150
return c
149151
}
150152

0 commit comments

Comments
 (0)