Skip to content

Commit

Permalink
roachprod: pass PGAuthMode to loadBalancerURL
Browse files Browse the repository at this point in the history
Epic: None
Release Note: None
  • Loading branch information
herkolategan committed Apr 24, 2024
1 parent 4edacf9 commit 8cb12bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/roachprod/install/cluster_synced.go
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,11 @@ func (c *SyncedCluster) pghosts(
// virtual cluster and SQL instance. Returns an empty string if a load balancer
// is not found.
func (c *SyncedCluster) loadBalancerURL(
ctx context.Context, l *logger.Logger, virtualClusterName string, sqlInstance int,
ctx context.Context,
l *logger.Logger,
virtualClusterName string,
sqlInstance int,
auth PGAuthMode,
) (string, error) {
services, err := c.DiscoverServices(ctx, virtualClusterName, ServiceTypeSQL)
if err != nil {
Expand All @@ -2677,7 +2681,7 @@ func (c *SyncedCluster) loadBalancerURL(
if err != nil {
return "", err
}
loadBalancerURL := c.NodeURL(address.IP, address.Port, virtualClusterName, serviceMode, AuthRootCert)
loadBalancerURL := c.NodeURL(address.IP, address.Port, virtualClusterName, serviceMode, auth)
return loadBalancerURL, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/roachprod/install/expander.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (e *expander) maybeExpandPgURL(
}
switch m[1] {
case ":L":
url, err := c.loadBalancerURL(ctx, l, virtualClusterName, sqlInstance)
url, err := c.loadBalancerURL(ctx, l, virtualClusterName, sqlInstance, AuthUserCert)
return url, url != "", err
default:
if e.pgURLs[virtualClusterName] == nil {
Expand Down

0 comments on commit 8cb12bd

Please sign in to comment.