@@ -433,7 +433,7 @@ func Run(
433
433
}
434
434
// If no nodes were specified, run on nodes derived from the clusterName.
435
435
if len (options .Nodes ) == 0 {
436
- options .Nodes = c .TargetNodes ()
436
+ options .Nodes = c .Nodes
437
437
}
438
438
439
439
cmd := strings .TrimSpace (strings .Join (cmdArray , " " ))
@@ -461,7 +461,7 @@ func RunWithDetails(
461
461
}
462
462
// If no nodes were specified, run on nodes derived from the clusterName.
463
463
if len (options .Nodes ) == 0 {
464
- options .Nodes = c .TargetNodes ()
464
+ options .Nodes = c .Nodes
465
465
}
466
466
cmd := strings .TrimSpace (strings .Join (cmdArray , " " ))
467
467
return c .RunWithDetails (ctx , l , options , TruncateString (cmd , 30 ), cmd )
@@ -557,7 +557,7 @@ func IP(l *logger.Logger, clusterName string, external bool) ([]string, error) {
557
557
return nil , err
558
558
}
559
559
560
- nodes := c .TargetNodes ()
560
+ nodes := c .Nodes
561
561
ips := make ([]string , len (nodes ))
562
562
563
563
for i := 0 ; i < len (nodes ); i ++ {
@@ -1126,7 +1126,7 @@ func PgURL(
1126
1126
if err != nil {
1127
1127
return nil , err
1128
1128
}
1129
- nodes := c .TargetNodes ()
1129
+ nodes := c .Nodes
1130
1130
ips := make ([]string , len (nodes ))
1131
1131
if opts .External {
1132
1132
for i := 0 ; i < len (nodes ); i ++ {
@@ -1262,7 +1262,7 @@ func AdminURL(
1262
1262
virtualClusterName : virtualClusterName ,
1263
1263
sqlInstance : sqlInstance ,
1264
1264
}
1265
- return urlGenerator (ctx , c , l , c .TargetNodes () , uConfig )
1265
+ return urlGenerator (ctx , c , l , c .Nodes , uConfig )
1266
1266
}
1267
1267
1268
1268
// SQLPorts finds the SQL ports for a cluster.
@@ -1350,7 +1350,7 @@ func Pprof(ctx context.Context, l *logger.Logger, clusterName string, opts Pprof
1350
1350
1351
1351
httpClient := httputil .NewClientWithTimeout (timeout )
1352
1352
startTime := timeutil .Now ().Unix ()
1353
- err = c .Parallel (ctx , l , install .WithNodes (c .TargetNodes () ).WithDisplay (description ),
1353
+ err = c .Parallel (ctx , l , install .WithNodes (c .Nodes ).WithDisplay (description ),
1354
1354
func (ctx context.Context , node install.Node ) (* install.RunResultDetails , error ) {
1355
1355
res := & install.RunResultDetails {Node : node }
1356
1356
host := c .Host (node )
@@ -2131,7 +2131,7 @@ func CreateSnapshot(
2131
2131
return nil , err
2132
2132
}
2133
2133
2134
- nodes := c .TargetNodes ()
2134
+ nodes := c .Nodes
2135
2135
nodesStatus , err := c .Status (ctx , l )
2136
2136
2137
2137
if err != nil {
@@ -2263,13 +2263,13 @@ func ApplySnapshots(
2263
2263
return err
2264
2264
}
2265
2265
2266
- if n := len (c .TargetNodes () ); n != len (snapshots ) {
2266
+ if n := len (c .Nodes ); n != len (snapshots ) {
2267
2267
return fmt .Errorf ("mismatched number of snapshots (%d) to node count (%d)" , len (snapshots ), n )
2268
2268
// TODO(irfansharif): Validate labels (version, instance types).
2269
2269
}
2270
2270
2271
2271
// Detach and delete existing volumes. This is destructive.
2272
- if err := c .Parallel (ctx , l , install .WithNodes (c .TargetNodes () ),
2272
+ if err := c .Parallel (ctx , l , install .WithNodes (c .Nodes ),
2273
2273
func (ctx context.Context , node install.Node ) (* install.RunResultDetails , error ) {
2274
2274
res := & install.RunResultDetails {Node : node }
2275
2275
@@ -2294,7 +2294,7 @@ func ApplySnapshots(
2294
2294
return err
2295
2295
}
2296
2296
2297
- return c .Parallel (ctx , l , install .WithNodes (c .TargetNodes () ),
2297
+ return c .Parallel (ctx , l , install .WithNodes (c .Nodes ),
2298
2298
func (ctx context.Context , node install.Node ) (* install.RunResultDetails , error ) {
2299
2299
res := & install.RunResultDetails {Node : node }
2300
2300
@@ -2406,7 +2406,7 @@ func StartJaeger(
2406
2406
// install from source or get linux binaries and start them
2407
2407
// with systemd. For now this just matches what we've been
2408
2408
// copy and pasting.
2409
- jaegerNode := c .TargetNodes () [len (c .TargetNodes () )- 1 :]
2409
+ jaegerNode := c .Nodes [len (c .Nodes )- 1 :]
2410
2410
err = install .InstallTool (ctx , l , c , jaegerNode , "docker" , l .Stdout , l .Stderr )
2411
2411
if err != nil {
2412
2412
return err
@@ -2458,7 +2458,7 @@ func StopJaeger(ctx context.Context, l *logger.Logger, clusterName string) error
2458
2458
if err != nil {
2459
2459
return err
2460
2460
}
2461
- jaegerNode := c .TargetNodes () [len (c .TargetNodes () )- 1 :]
2461
+ jaegerNode := c .Nodes [len (c .Nodes )- 1 :]
2462
2462
stopCmd := fmt .Sprintf ("docker stop %s" , jaegerContainerName )
2463
2463
err = c .Run (ctx , l , l .Stdout , l .Stderr , install .WithNodes (jaegerNode ), stopCmd , stopCmd )
2464
2464
if err != nil {
@@ -2477,7 +2477,7 @@ func JaegerURL(
2477
2477
if err != nil {
2478
2478
return "" , err
2479
2479
}
2480
- jaegerNode := c .TargetNodes () [len (c .TargetNodes () )- 1 :]
2480
+ jaegerNode := c .Nodes [len (c .Nodes )- 1 :]
2481
2481
urls , err := urlGenerator (ctx , c , l , jaegerNode , urlConfig {
2482
2482
usePublicIP : true ,
2483
2483
openInBrowser : openInBrowser ,
@@ -2619,7 +2619,7 @@ func StorageCollectionPerformAction(
2619
2619
}
2620
2620
2621
2621
func printNodeToVolumeMapping (c * install.SyncedCluster ) {
2622
- nodes := c .TargetNodes ()
2622
+ nodes := c .Nodes
2623
2623
for _ , n := range nodes {
2624
2624
cVM := c .VMs [n - 1 ]
2625
2625
for _ , volume := range cVM .NonBootAttachedVolumes {
@@ -2633,7 +2633,7 @@ func printNodeToVolumeMapping(c *install.SyncedCluster) {
2633
2633
func sendCaptureCommand (
2634
2634
ctx context.Context , l * logger.Logger , c * install.SyncedCluster , action string , captureDir string ,
2635
2635
) error {
2636
- nodes := c .TargetNodes ()
2636
+ nodes := c .Nodes
2637
2637
httpClient := httputil .NewClientWithTimeout (0 /* timeout: None */ )
2638
2638
_ , _ , err := c .ParallelE (ctx , l , install .WithNodes (nodes ).WithDisplay (fmt .Sprintf ("Performing workload capture %s" , action )),
2639
2639
func (ctx context.Context , node install.Node ) (* install.RunResultDetails , error ) {
@@ -2713,7 +2713,7 @@ func createAttachMountVolumes(
2713
2713
opts vm.VolumeCreateOpts ,
2714
2714
mountDir string ,
2715
2715
) error {
2716
- nodes := c .TargetNodes ()
2716
+ nodes := c .Nodes
2717
2717
for idx , n := range nodes {
2718
2718
curNode := nodes [idx : idx + 1 ]
2719
2719
@@ -2780,7 +2780,7 @@ func CreateLoadBalancer(
2780
2780
// Find the SQL ports for the service on all nodes.
2781
2781
services , err := c .DiscoverServices (
2782
2782
ctx , virtualClusterName , install .ServiceTypeSQL ,
2783
- install .ServiceNodePredicate (c .TargetNodes () ... ), install .ServiceInstancePredicate (sqlInstance ),
2783
+ install .ServiceNodePredicate (c .Nodes ... ), install .ServiceInstancePredicate (sqlInstance ),
2784
2784
)
2785
2785
if err != nil {
2786
2786
return err
@@ -2909,7 +2909,7 @@ func Deploy(
2909
2909
}
2910
2910
2911
2911
stageDir := "stage-cockroach"
2912
- err = c .Run (ctx , l , l .Stdout , l .Stderr , install .WithNodes (c .TargetNodes () ), "creating staging dir" ,
2912
+ err = c .Run (ctx , l , l .Stdout , l .Stderr , install .WithNodes (c .Nodes ), "creating staging dir" ,
2913
2913
fmt .Sprintf ("rm -rf %[1]s && mkdir -p %[1]s" , stageDir ))
2914
2914
if err != nil {
2915
2915
return err
@@ -2919,7 +2919,7 @@ func Deploy(
2919
2919
if pathToBinary == "" {
2920
2920
return errors .Errorf ("%s application requires a path to the binary" , applicationName )
2921
2921
}
2922
- err = c .Put (ctx , l , c .TargetNodes () , pathToBinary , filepath .Join (stageDir , "cockroach" ))
2922
+ err = c .Put (ctx , l , c .Nodes , pathToBinary , filepath .Join (stageDir , "cockroach" ))
2923
2923
} else {
2924
2924
err = Stage (ctx , l , clusterName , "" , "" , stageDir , applicationName , version )
2925
2925
}
@@ -2929,7 +2929,7 @@ func Deploy(
2929
2929
}
2930
2930
2931
2931
l .Printf ("Performing rolling restart of %d nodes on %s" , len (c .VMs ), clusterName )
2932
- for _ , node := range c .TargetNodes () {
2932
+ for _ , node := range c .Nodes {
2933
2933
curNode := []install.Node {node }
2934
2934
2935
2935
err = c .WithNodes (curNode ).Stop (ctx , l , sig , wait , gracePeriod , "" )
0 commit comments