Skip to content

Commit

Permalink
ING-952: Add handling to test harness for single-node clusters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett Lawson committed Oct 25, 2024
1 parent 9a76267 commit 5cc1708
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions testutilsint/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package testutilsint
import (
"context"
"fmt"
"net/url"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -105,14 +106,21 @@ func GetTestNodes(t *testing.T) NodeTargetList {
config, err := getTestMgmt().GetTerseClusterConfig(context.Background(), &cbmgmtx.GetTerseClusterConfigOptions{})
require.NoError(t, err)

srcUrl, _ := url.Parse(getTestMgmt().Endpoint)
srcHostname := srcUrl.Hostname()
orchestratorNsAddr := getOrchestratorNsAddr(t)

var nodes []*NodeTarget
for _, nodeExt := range config.NodesExt {
nsAddress := fmt.Sprintf("%s:%d", nodeExt.Hostname, nodeExt.Services.Mgmt)
hostname := nodeExt.Hostname
if hostname == "" {
hostname = srcHostname
}

nsAddress := fmt.Sprintf("%s:%d", hostname, nodeExt.Services.Mgmt)

nodes = append(nodes, &NodeTarget{
Hostname: nodeExt.Hostname,
Hostname: hostname,
NsPort: nodeExt.Services.Mgmt,
QueryPort: nodeExt.Services.N1ql,
SearchPort: nodeExt.Services.Fts,
Expand Down

0 comments on commit 5cc1708

Please sign in to comment.