Skip to content

Commit

Permalink
🌱 improve event of GetHardwareDetailsDebug
Browse files Browse the repository at this point in the history
don't show "stderr" if there is no output.
  • Loading branch information
guettli committed Mar 18, 2024
1 parent 43b8a53 commit ae5e47b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/services/baremetal/host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,11 @@ func (s *Service) actionRegistering() actionResult {
if output.Err != nil {
return actionError{err: fmt.Errorf("failed to obtain hardware for debugging: %w", output.Err)}
}
record.Eventf(s.scope.HetznerBareMetalHost, "GetHardwareDetails", "%s\n\nstderr:\n%s", output.StdOut, out.StdErr)
msg := fmt.Sprintf("%s\n\n", output.StdOut)
if out.StdErr != "" {
msg += fmt.Sprintf("stderr:\n%s\n\n", out.StdErr)
}
record.Eventf(s.scope.HetznerBareMetalHost, "GetHardwareDetails", msg)

if s.scope.HetznerBareMetalHost.Spec.Status.HardwareDetails == nil {
hardwareDetails, err := getHardwareDetails(sshClient)
Expand Down

0 comments on commit ae5e47b

Please sign in to comment.