Skip to content

Commit

Permalink
Merge #91804
Browse files Browse the repository at this point in the history
91804: roachtest: use correct certs directory r=msbutler a=stevendanna

I did a last minute refactor but only tested it on a local cluster. It seems Put on a directory works different locally vs remotely.

Fixes #91791

Release note: None

Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
craig[bot] and stevendanna committed Nov 13, 2022
2 parents af18b5d + d479bad commit f82dead
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/cmd/roachtest/tests/cluster_to_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,15 @@ func copyPGCertsAndMakeURL(

dir := "."
if c.IsLocal() {
dir = local.VMDir(c.Name(), destNode[0])
dir = filepath.Join(local.VMDir(c.Name(), destNode[0]), "src-cluster-certs")
} else {
dir = "./src-cluster-certs/certs"
}
options := pgURL.Query()
options.Set("sslmode", "verify-full")
options.Set("sslrootcert", filepath.Join(dir, "src-cluster-certs", "ca.crt"))
options.Set("sslcert", filepath.Join(dir, "src-cluster-certs", "client.root.crt"))
options.Set("sslkey", filepath.Join(dir, "src-cluster-certs", "client.root.key"))
options.Set("sslrootcert", filepath.Join(dir, "ca.crt"))
options.Set("sslcert", filepath.Join(dir, "client.root.crt"))
options.Set("sslkey", filepath.Join(dir, "client.root.key"))
pgURL.RawQuery = options.Encode()
return pgURL.String(), cleanup, err
}

0 comments on commit f82dead

Please sign in to comment.