From 3d2d9b78e80d6611d94951e006edb71f16d1d7a2 Mon Sep 17 00:00:00 2001 From: Connor Edwards <38229097+cedws@users.noreply.github.com> Date: Sun, 9 Feb 2025 18:39:44 +0000 Subject: [PATCH] fix: rename IdentityFile to SSHKeyFile --- internal/cli/cli.go | 6 +++--- internal/cli/config/connection.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 95cbd241..7accb247 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -92,7 +92,7 @@ func (cli *CLI) ConnectCluster(ctx context.Context, clusterName string) (*client return nil, fmt.Errorf("parse SSH connection %q: %w", conn.SSH, err) } - keyPath := fs.ExpandHomeDir(conn.IdentityFile) + keyPath := fs.ExpandHomeDir(conn.SSHKeyFile) sshConfig := &connector.SSHConnectorConfig{ User: user, @@ -166,8 +166,8 @@ func (cli *CLI) initRemoteMachine( // Save the machine's SSH connection details in the cluster config. connCfg := config.MachineConnection{ - SSH: config.NewSSHDestination(remoteMachine.User, remoteMachine.Host, remoteMachine.Port), - IdentityFile: remoteMachine.KeyPath, + SSH: config.NewSSHDestination(remoteMachine.User, remoteMachine.Host, remoteMachine.Port), + SSHKeyFile: remoteMachine.KeyPath, } cli.config.Clusters[clusterName].Connections = append(cli.config.Clusters[clusterName].Connections, connCfg) if err = cli.config.Save(); err != nil { diff --git a/internal/cli/config/connection.go b/internal/cli/config/connection.go index 736f4a3f..97273872 100644 --- a/internal/cli/config/connection.go +++ b/internal/cli/config/connection.go @@ -14,11 +14,11 @@ const ( ) type MachineConnection struct { - SSH SSHDestination `toml:"ssh,omitempty"` - TCP netip.AddrPort `toml:"tcp,omitempty"` - Host string `toml:"host,omitempty"` - PublicKey secret.Secret `toml:"public_key,omitempty"` - IdentityFile string `toml:"identity_file,omitempty"` + SSH SSHDestination `toml:"ssh,omitempty"` + TCP netip.AddrPort `toml:"tcp,omitempty"` + Host string `toml:"host,omitempty"` + PublicKey secret.Secret `toml:"public_key,omitempty"` + SSHKeyFile string `toml:"ssh_key_file,omitempty"` } // SSHDestination represents an SSH destination string in the canonical form of "user@host:port".