Skip to content

Commit

Permalink
Remove unused wait group
Browse files Browse the repository at this point in the history
The 'WaitForSSHToBeReady()' call will make it to wait until
the VM is ready, to stop printing the console.

Signed-off-by: German Maglione <[email protected]>
  • Loading branch information
germag committed Jul 4, 2024
1 parent 99db38c commit 5312ba9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"os"
"sync"
"time"

"github.com/containers/podman-bootc/pkg/bootc"
Expand Down Expand Up @@ -159,8 +158,6 @@ func doRun(flags *cobra.Command, args []string) error {

if !vmConfig.Background {
if !vmConfig.Quiet {
var vmConsoleWg sync.WaitGroup
vmConsoleWg.Add(1)
go func() {
err := bootcVM.PrintConsole()
if err != nil {
Expand All @@ -173,8 +170,6 @@ func doRun(flags *cobra.Command, args []string) error {
return fmt.Errorf("WaitSshReady: %w", err)
}

vmConsoleWg.Done() //stop printing the VM console when SSH is ready

// the PrintConsole routine is suddenly stopped without waiting for
// the print buffer to be flushed, this can lead to the consoel output
// printing after the ssh prompt begins. Sleeping for a second
Expand Down

0 comments on commit 5312ba9

Please sign in to comment.