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.

And create event for NoLinuxOnAnotherDisk, even if ok.
  • Loading branch information
guettli committed Mar 18, 2024
1 parent 43b8a53 commit 6c9ec80
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 6c9ec80

Please sign in to comment.