Skip to content

Commit

Permalink
roachprod: fix node url parsing issue
Browse files Browse the repository at this point in the history
Passing node url without quoting it causes issues in parsing
it and results in ignoring some parameters.

This patch fixes this by quoting node url.

Release note: None
  • Loading branch information
Ahmad Abedalqader committed Nov 28, 2021
1 parent 3b30a0e commit 4b8321f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,9 @@ func (c *clusterImpl) pgURLErr(
if err != nil {
return nil, err
}
for i, url := range urls {
urls[i] = strings.Trim(url, "'")
}
return urls, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/roachprod/install/cockroach.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (c *SyncedCluster) NodeURL(host string, port int) string {
v.Add("sslmode", "disable")
}
u.RawQuery = v.Encode()
return u.String()
return "'" + u.String() + "'"
}

// NodePort returns the SQL port for the given node.
Expand Down

0 comments on commit 4b8321f

Please sign in to comment.