Skip to content

Commit

Permalink
DO NOT MERGE: Flake hunting
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Cui <[email protected]>
  • Loading branch information
ashley-cui committed Aug 11, 2024
1 parent 277e061 commit 3ba5f13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/machine/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ func generatekeys(writeLocation string) error {
if err := cmd.Start(); err != nil {
return err
}
errMsg, ioErr := io.ReadAll(stdErr)

waitErr := cmd.Wait()
if waitErr == nil {
return nil
}
errMsg, err := io.ReadAll(stdErr)
if err != nil {
return fmt.Errorf("key generation failed, unable to read from stderr: %w", waitErr)
if ioErr != nil {
return fmt.Errorf("key generation failed, unable to read from stderr: %w", ioErr)
}
return fmt.Errorf("failed to generate keys: %s: %w", string(errMsg), waitErr)
}
Expand Down

0 comments on commit 3ba5f13

Please sign in to comment.