Skip to content

Commit 647ab5d

Browse files
jmezzacappaabrightwell
authored andcommitted
cb logs: Use tempkey .host
This uses the `.host` from the tempkey JSON instead of the hardcoded format, which is useful when using an alternative `CB_HOST`.
1 parent 05c79e7 commit 647ab5d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/cb/logs.cr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ module CB
1818

1919
tk = Tempkey.for_cluster cluster_id[:cluster], client: client
2020

21-
host = "p.#{cluster_id[:cluster]}.db.postgresbridge.com"
22-
socket = TCPSocket.new(host, 22, connect_timeout: 1)
21+
socket = TCPSocket.new(tk.host, 22, connect_timeout: 1)
2322
ssh = SSH2::Session.new(socket)
2423
ssh.login_with_data("cormorant", tk.private_key, tk.public_key)
2524

src/cb/tempkey.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module CB
2-
record Tempkey, private_key : String, public_key : String, cluster_id : String, team_id : String, expires_at : Time do
2+
record Tempkey, host : String, private_key : String, public_key : String, cluster_id : String, team_id : String, expires_at : Time do
33
Cacheable.include key: cluster_id
44

55
def self.for_cluster(cluster_id : Identifier, client) : Tempkey

0 commit comments

Comments
 (0)