@@ -2469,19 +2469,10 @@ func (c *clusterImpl) loggerForCmd(
24692469// internal IPs and communication from a test driver to nodes in a cluster
24702470// should use external IPs.
24712471func (c * clusterImpl ) pgURLErr (
2472- ctx context.Context ,
2473- l * logger.Logger ,
2474- nodes option.NodeListOption ,
2475- external bool ,
2476- tenant string ,
2477- sqlInstance int ,
2472+ ctx context.Context , l * logger.Logger , nodes option.NodeListOption , opts roachprod.PGURLOptions ,
24782473) ([]string , error ) {
2479- urls , err := roachprod .PgURL (ctx , l , c .MakeNodes (nodes ), c .localCertsDir , roachprod.PGURLOptions {
2480- External : external ,
2481- Secure : c .localCertsDir != "" ,
2482- VirtualClusterName : tenant ,
2483- SQLInstance : sqlInstance ,
2484- })
2474+ opts .Secure = c .IsSecure ()
2475+ urls , err := roachprod .PgURL (ctx , l , c .MakeNodes (nodes ), c .localCertsDir , opts )
24852476 if err != nil {
24862477 return nil , err
24872478 }
@@ -2493,27 +2484,20 @@ func (c *clusterImpl) pgURLErr(
24932484
24942485// InternalPGUrl returns the internal Postgres endpoint for the specified nodes.
24952486func (c * clusterImpl ) InternalPGUrl (
2496- ctx context.Context ,
2497- l * logger.Logger ,
2498- nodes option.NodeListOption ,
2499- tenant string ,
2500- sqlInstance int ,
2487+ ctx context.Context , l * logger.Logger , nodes option.NodeListOption , opts roachprod.PGURLOptions ,
25012488) ([]string , error ) {
2502- return c .pgURLErr (ctx , l , nodes , false , tenant , sqlInstance )
2489+ return c .pgURLErr (ctx , l , nodes , opts )
25032490}
25042491
25052492// Silence unused warning.
25062493var _ = (& clusterImpl {}).InternalPGUrl
25072494
25082495// ExternalPGUrl returns the external Postgres endpoint for the specified nodes.
25092496func (c * clusterImpl ) ExternalPGUrl (
2510- ctx context.Context ,
2511- l * logger.Logger ,
2512- nodes option.NodeListOption ,
2513- tenant string ,
2514- sqlInstance int ,
2497+ ctx context.Context , l * logger.Logger , nodes option.NodeListOption , opts roachprod.PGURLOptions ,
25152498) ([]string , error ) {
2516- return c .pgURLErr (ctx , l , nodes , true , tenant , sqlInstance )
2499+ opts .External = true
2500+ return c .pgURLErr (ctx , l , nodes , opts )
25172501}
25182502
25192503func addrToAdminUIAddr (addr string ) (string , error ) {
@@ -2642,7 +2626,7 @@ func (c *clusterImpl) addr(
26422626 ctx context.Context , l * logger.Logger , nodes option.NodeListOption , external bool ,
26432627) ([]string , error ) {
26442628 var addrs []string
2645- urls , err := c .pgURLErr (ctx , l , nodes , external , "" /* tenant */ , 0 /* sqlInstance */ )
2629+ urls , err := c .pgURLErr (ctx , l , nodes , roachprod. PGURLOptions { External : external } )
26462630 if err != nil {
26472631 return nil , err
26482632 }
@@ -2700,7 +2684,10 @@ func (c *clusterImpl) ConnE(
27002684 for _ , opt := range opts {
27012685 opt (connOptions )
27022686 }
2703- urls , err := c .ExternalPGUrl (ctx , l , c .Node (node ), connOptions .TenantName , connOptions .SQLInstance )
2687+ urls , err := c .ExternalPGUrl (ctx , l , c .Node (node ), roachprod.PGURLOptions {
2688+ VirtualClusterName : connOptions .TenantName ,
2689+ SQLInstance : connOptions .SQLInstance ,
2690+ })
27042691 if err != nil {
27052692 return nil , err
27062693 }
0 commit comments