From 2969b40ad42d0b2c6f58e269114853605fff123e Mon Sep 17 00:00:00 2001 From: Pasha Sviderski Date: Thu, 25 Sep 2025 20:53:19 +1000 Subject: [PATCH] chore: return a proxy dialer for SSH connections --- pkg/client/connector/ssh.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/client/connector/ssh.go b/pkg/client/connector/ssh.go index 38812022..a0bfa23e 100644 --- a/pkg/client/connector/ssh.go +++ b/pkg/client/connector/ssh.go @@ -2,6 +2,7 @@ package connector import ( "context" + "errors" "fmt" "net" "strings" @@ -80,8 +81,13 @@ func (c *SSHConnector) Connect(ctx context.Context) (*grpc.ClientConn, error) { return conn, nil } +// Dialer returns a proxy dialer for establishing connections within the cluster through the SSH tunnel. +// The connector must be created with an existing SSH client or Connect must be called first. func (c *SSHConnector) Dialer() (proxy.ContextDialer, error) { - return nil, fmt.Errorf("dialer not implemented for SSHConnector yet") + if c.client == nil { + return nil, errors.New("SSH connection must be established first") + } + return c.client, nil } func (c *SSHConnector) Close() error {