@@ -275,9 +275,9 @@ func ExactScopeMatch(addr Address, addrScopes ...Scope) bool {
275
275
return false
276
276
}
277
277
278
- // SelectAddressBySpaces picks the first address from the given slice that has
278
+ // SelectAddressBySpaceNames picks the first address from the given slice that has
279
279
// the given space name associated.
280
- func SelectAddressBySpaces (addresses []Address , spaceNames ... SpaceName ) (Address , bool ) {
280
+ func SelectAddressBySpaceNames (addresses []Address , spaceNames ... SpaceName ) (Address , bool ) {
281
281
for _ , addr := range addresses {
282
282
if spaceNameList (spaceNames ).IndexOf (addr .SpaceName ) >= 0 {
283
283
logger .Debugf ("selected %q as first address in space %q" , addr .Value , addr .SpaceName )
@@ -293,9 +293,9 @@ func SelectAddressBySpaces(addresses []Address, spaceNames ...SpaceName) (Addres
293
293
return Address {}, false
294
294
}
295
295
296
- // SelectHostPortsBySpaces filters the input slice of HostPorts down to
296
+ // SelectHostPortsBySpaceNames filters the input slice of HostPorts down to
297
297
// those in the inpu space name.
298
- func SelectHostPortsBySpaces (hps []HostPort , spaceNames ... SpaceName ) ([]HostPort , bool ) {
298
+ func SelectHostPortsBySpaceNames (hps []HostPort , spaceNames ... SpaceName ) ([]HostPort , bool ) {
299
299
if len (spaceNames ) == 0 {
300
300
logger .Errorf ("host ports not filtered - no spaces given." )
301
301
return hps , false
@@ -331,15 +331,15 @@ func SelectControllerAddress(addresses []Address, machineLocal bool) (Address, b
331
331
return internalAddress , ok
332
332
}
333
333
334
- // SelectMongoHostPortsBySpaces returns the most suitable HostPort (as string) to
334
+ // SelectMongoHostPortsBySpaceNames returns the most suitable HostPort (as string) to
335
335
// use as a Juju Controller (API/state server) endpoint given the list of
336
336
// hostPorts. It first tries to find the first HostPort bound to the
337
337
// spaces provided, then, if that fails, uses the older selection method based on scope.
338
338
// When machineLocal is true and an address can't be selected by space both
339
339
// ScopeCloudLocal and ScopeMachineLocal addresses are considered during the
340
340
// selection, otherwise just ScopeCloudLocal are.
341
- func SelectMongoHostPortsBySpaces (hostPorts []HostPort , spaces []SpaceName ) ([]string , bool ) {
342
- filteredHostPorts , ok := SelectHostPortsBySpaces (hostPorts , spaces ... )
341
+ func SelectMongoHostPortsBySpaceNames (hostPorts []HostPort , spaces []SpaceName ) ([]string , bool ) {
342
+ filteredHostPorts , ok := SelectHostPortsBySpaceNames (hostPorts , spaces ... )
343
343
if ok {
344
344
logger .Debugf (
345
345
"selected %q as controller host:port, using spaces %q" ,
0 commit comments