Skip to content

Commit 3bc16ac

Browse files
authored
🌱 improve event of GetHardwareDetailsDebug (#1212)
don't show "stderr" if there is no output. And create event for NoLinuxOnAnotherDisk, even if ok.
1 parent 9cb2d1e commit 3bc16ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/services/baremetal/host/host.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,11 @@ func (s *Service) actionRegistering() actionResult {
541541
if output.Err != nil {
542542
return actionError{err: fmt.Errorf("failed to obtain hardware for debugging: %w", output.Err)}
543543
}
544-
record.Eventf(s.scope.HetznerBareMetalHost, "GetHardwareDetails", "%s\n\nstderr:\n%s", output.StdOut, out.StdErr)
544+
msg := fmt.Sprintf("%s\n\n", output.StdOut)
545+
if out.StdErr != "" {
546+
msg += fmt.Sprintf("stderr:\n%s\n\n", out.StdErr)
547+
}
548+
record.Eventf(s.scope.HetznerBareMetalHost, "GetHardwareDetails", msg)
545549

546550
if s.scope.HetznerBareMetalHost.Spec.Status.HardwareDetails == nil {
547551
hardwareDetails, err := getHardwareDetails(sshClient)
@@ -1007,6 +1011,7 @@ func (s *Service) actionImageInstalling() actionResult {
10071011
delay: 10 * time.Second,
10081012
}
10091013
}
1014+
record.Eventf(s.scope.HetznerBareMetalHost, "NoLinuxOnAnotherDisk", "OK, no Linux on another disk:\n%s\n\n%s", out.StdOut, out.StdErr)
10101015

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

0 commit comments

Comments
 (0)