Skip to content

Commit

Permalink
🌱 improve event of GetHardwareDetailsDebug (#1212)
Browse files Browse the repository at this point in the history
don't show "stderr" if there is no output.

And create event for NoLinuxOnAnotherDisk, even if ok.
  • Loading branch information
guettli authored Mar 18, 2024
1 parent 9cb2d1e commit 3bc16ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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 Expand Up @@ -1007,6 +1011,7 @@ func (s *Service) actionImageInstalling() actionResult {
delay: 10 * time.Second,
}
}
record.Eventf(s.scope.HetznerBareMetalHost, "NoLinuxOnAnotherDisk", "OK, no Linux on another disk:\n%s\n\n%s", out.StdOut, out.StdErr)

// if the previous reconcile was stopped, then wait until the first
// run of installimage was finished.
Expand Down

0 comments on commit 3bc16ac

Please sign in to comment.