diff --git a/pkg/cmd/roachprod/main.go b/pkg/cmd/roachprod/main.go index c4b41f33f88f..09ec91d26f38 100644 --- a/pkg/cmd/roachprod/main.go +++ b/pkg/cmd/roachprod/main.go @@ -572,6 +572,8 @@ environment variables to the cockroach process. install.EnvOption(nodeEnv), install.NumRacksOption(numRacks), } + // TODO(DarrylWong): remove once #117125 is addressed. + startOpts.AdminUIPort = 0 startOpts.Target = install.StartSharedProcessForVirtualCluster if externalProcessNodes != "" { diff --git a/pkg/roachprod/install/cockroach.go b/pkg/roachprod/install/cockroach.go index 2689bee7b5e3..4a40134990e3 100644 --- a/pkg/roachprod/install/cockroach.go +++ b/pkg/roachprod/install/cockroach.go @@ -344,13 +344,17 @@ func (c *SyncedCluster) Start(ctx context.Context, l *logger.Logger, startOpts S if startOpts.Target == StartRoutingProxy { return fmt.Errorf("start SQL proxy not implemented") } + // Local clusters do not support specifying ports. An error is returned if we // detect that they were set. - if c.IsLocal() && (startOpts.SQLPort != 0 || startOpts.AdminUIPort != 0) { + if c.IsLocal() { // We don't need to return an error if the ports are the default values // specified in DefaultStartOps, as these have not been specified explicitly // by the user. - if startOpts.SQLPort != config.DefaultSQLPort || startOpts.AdminUIPort != config.DefaultAdminUIPort { + if startOpts.SQLPort != 0 && startOpts.SQLPort != config.DefaultSQLPort { + return fmt.Errorf("local clusters do not support specifying ports") + } + if startOpts.AdminUIPort != 0 && startOpts.AdminUIPort != config.DefaultAdminUIPort { return fmt.Errorf("local clusters do not support specifying ports") } startOpts.SQLPort = 0 diff --git a/pkg/roachprod/roachprod.go b/pkg/roachprod/roachprod.go index fa59a224685f..2f7067871eb7 100644 --- a/pkg/roachprod/roachprod.go +++ b/pkg/roachprod/roachprod.go @@ -689,7 +689,8 @@ func DefaultStartOpts() install.StartOpts { InitTarget: 1, SQLPort: 0, VirtualClusterName: install.SystemInterfaceName, - AdminUIPort: 0, + // TODO(DarrylWong): revert back to 0 once #117125 is addressed. + AdminUIPort: config.DefaultAdminUIPort, } }