File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ func (cfg *namespaceConfig) initFromViper(v *viper.Viper) {
216
216
cfg .MaxRetryAttempts = v .GetInt (cfg .namespace + suffixMaxRetryAttempts )
217
217
cfg .Timeout = v .GetDuration (cfg .namespace + suffixTimeout )
218
218
cfg .ReconnectInterval = v .GetDuration (cfg .namespace + suffixReconnectInterval )
219
- cfg .servers = v .GetString (cfg .namespace + suffixServers )
219
+ cfg .servers = stripWhiteSpace ( v .GetString (cfg .namespace + suffixServers ) )
220
220
cfg .Port = v .GetInt (cfg .namespace + suffixPort )
221
221
cfg .Keyspace = v .GetString (cfg .namespace + suffixKeyspace )
222
222
cfg .LocalDC = v .GetString (cfg .namespace + suffixDC )
@@ -256,3 +256,8 @@ func (opt *Options) Get(namespace string) *config.Configuration {
256
256
nsCfg .Servers = strings .Split (nsCfg .servers , "," )
257
257
return & nsCfg .Configuration
258
258
}
259
+
260
+ // stripWhiteSpace removes all whitespace characters from a string
261
+ func stripWhiteSpace (str string ) string {
262
+ return strings .Replace (str , " " , "" , - 1 )
263
+ }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func TestOptionsWithFlags(t *testing.T) {
50
50
command .ParseFlags ([]string {
51
51
"--cas.keyspace=jaeger" ,
52
52
"--cas.local-dc=mojave" ,
53
- "--cas.servers=1.1.1.1,2.2.2.2" ,
53
+ "--cas.servers=1.1.1.1, 2.2.2.2" ,
54
54
"--cas.connections-per-host=42" ,
55
55
"--cas.reconnect-interval=42s" ,
56
56
"--cas.max-retry-attempts=42" ,
@@ -62,7 +62,7 @@ func TestOptionsWithFlags(t *testing.T) {
62
62
// enable aux with a couple overrides
63
63
"--cas-aux.enabled=true" ,
64
64
"--cas-aux.keyspace=jaeger-archive" ,
65
- "--cas-aux.servers=3.3.3.3,4.4.4.4" ,
65
+ "--cas-aux.servers=3.3.3.3, 4.4.4.4" ,
66
66
})
67
67
opts .InitFromViper (v )
68
68
You can’t perform that action at this time.
0 commit comments