Skip to content

Commit

Permalink
fix: properly handle no child processes error from cmd.Wait
Browse files Browse the repository at this point in the history
I guess that happens when the process ends before `Wait` kicks in.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
  • Loading branch information
Unix4ever authored and talos-bot committed Feb 15, 2021
1 parent 04a9851 commit 1cf7f25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blockdevice/encryption/luks/luks.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ func (l *LUKS) runCommand(args []string, stdin []byte) error {
}
}

return fmt.Errorf("failed to call cryptsetup: %w, output: %s", err, out.String())
if !strings.Contains(err.Error(), "no child processes") {
return fmt.Errorf("failed to call cryptsetup: %w, output: %s", err, out.String())
}
}

return nil
Expand Down

0 comments on commit 1cf7f25

Please sign in to comment.