Skip to content

Commit

Permalink
fix: install flake waiting for k0s (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh authored Oct 15, 2024
1 parent 0851b39 commit a5c2378
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/embedded-cluster/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,16 @@ func waitForK0s() error {
if !success {
return fmt.Errorf("timeout waiting for %s", defaults.BinaryName())
}
if _, err := helpers.RunCommand(defaults.K0sBinaryPath(), "status"); err != nil {
return fmt.Errorf("unable to get status: %w", err)

for i := 1; ; i++ {
_, err := helpers.RunCommand(defaults.K0sBinaryPath(), "status")
if err == nil {
return nil
} else if i == 5 {
return fmt.Errorf("unable to get status: %w", err)
}
time.Sleep(2 * time.Second)
}
return nil
}

// installAndWaitForK0s installs the k0s binary and waits for it to be ready
Expand Down

0 comments on commit a5c2378

Please sign in to comment.