Skip to content

Commit

Permalink
Defer ssh.Close() to always close SSH connection in prepare (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
middagj authored Jan 22, 2025
1 parent 7973405 commit 9211227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/commands/prepare/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func runPrepareVM(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
defer ssh.Close()

log.Println("Was able to SSH!")

Expand Down Expand Up @@ -251,7 +252,7 @@ func runPrepareVM(cmd *cobra.Command, args []string) error {

log.Println("VM is ready.")

return ssh.Close()
return nil
}

func ensureImageIsAllowed(image string) error {
Expand Down

0 comments on commit 9211227

Please sign in to comment.