Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
62391: cli: support addr 0 in multi-node demo r=knz a=ajwerner

Before this change, if you specified that the ports should be chosen by the
system with `--http-port 0 --sql-port 0` then it would not work for multi-node
demo. This fixes that.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Mar 23, 2021
2 parents 3f9f18e + 2008b33 commit 4fb8e2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cli/demo_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@ func testServerArgsForTransientCluster(
// Unit tests can be run with multiple processes side-by-side with
// `make stress`. This is bound to not work with fixed ports.
sqlPort := sqlBasePort + int(nodeID) - 1
if sqlBasePort == 0 {
sqlPort = 0
}
httpPort := httpBasePort + int(nodeID) - 1
if httpBasePort == 0 {
httpPort = 0
}
args.SQLAddr = fmt.Sprintf(":%d", sqlPort)
args.HTTPAddr = fmt.Sprintf(":%d", httpPort)
}
Expand Down

0 comments on commit 4fb8e2d

Please sign in to comment.