From 99219dc3762de02d3f51ba7171d11401b66e36c1 Mon Sep 17 00:00:00 2001 From: Connor Edwards <38229097+cedws@users.noreply.github.com> Date: Sat, 8 Feb 2025 15:59:05 +0000 Subject: [PATCH] fix: set identity_file in config after init --- internal/cli/cli.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 904b0b5b..95cbd241 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -163,9 +163,11 @@ func (cli *CLI) initRemoteMachine( return fmt.Errorf("set current cluster: %w", err) } } + // Save the machine's SSH connection details in the cluster config. connCfg := config.MachineConnection{ - SSH: config.NewSSHDestination(remoteMachine.User, remoteMachine.Host, remoteMachine.Port), + SSH: config.NewSSHDestination(remoteMachine.User, remoteMachine.Host, remoteMachine.Port), + IdentityFile: remoteMachine.KeyPath, } cli.config.Clusters[clusterName].Connections = append(cli.config.Clusters[clusterName].Connections, connCfg) if err = cli.config.Save(); err != nil {