Skip to content

Commit

Permalink
Orphan: Fixed where blank CAPI endpoints might be returned during reb…
Browse files Browse the repository at this point in the history
…alance.

Change-Id: Ic0a7c466e220644d4095dd8b495065a87ad9c7f9
Reviewed-on: http://review.couchbase.org/55107
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information
brett19 committed Sep 10, 2015
1 parent 8f64913 commit e845bcd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gocbcore/routeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ func buildRouteConfig(bk *cfgBucket, useSsl bool) *routeConfig {
kvServerList = bk.VBucketServerMap.ServerList

for _, node := range bk.Nodes {
// Slice off the UUID as Go's HTTP client cannot handle being passed URL-Encoded path values.
capiEp := strings.SplitN(node.CouchAPIBase, "%2B", 2)[0]
if node.CouchAPIBase != "" {
// Slice off the UUID as Go's HTTP client cannot handle being passed URL-Encoded path values.
capiEp := strings.SplitN(node.CouchAPIBase, "%2B", 2)[0]

// Add this node to the list of nodes.
capiEpList = append(capiEpList, capiEp)
mgmtEpList = append(mgmtEpList, fmt.Sprintf("http://%s", node.Hostname))
capiEpList = append(capiEpList, capiEp)
}
if node.Hostname != "" {
mgmtEpList = append(mgmtEpList, fmt.Sprintf("http://%s", node.Hostname))
}
}
}

Expand Down

0 comments on commit e845bcd

Please sign in to comment.