fix: set identity_file in config after init

This commit is contained in:
Connor Edwards
2025-02-08 15:59:05 +00:00
parent 408703360c
commit 99219dc376
+3 -1
View File
@@ -163,9 +163,11 @@ func (cli *CLI) initRemoteMachine(
return fmt.Errorf("set current cluster: %w", err) return fmt.Errorf("set current cluster: %w", err)
} }
} }
// Save the machine's SSH connection details in the cluster config. // Save the machine's SSH connection details in the cluster config.
connCfg := config.MachineConnection{ 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) cli.config.Clusters[clusterName].Connections = append(cli.config.Clusters[clusterName].Connections, connCfg)
if err = cli.config.Save(); err != nil { if err = cli.config.Save(); err != nil {