Skip to content

Commit 893d9f6

Browse files
authored
🌱 Before using the ssh Rescue Client, ensure the rescue system is active. Log reboot events (#1598)
1 parent 7d831b7 commit 893d9f6

File tree

5 files changed

+105
-51
lines changed

5 files changed

+105
-51
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,6 @@ watchall-output*
7979

8080
/*.kubeconfig
8181
/*.log
82+
/conditions*.txt
8283

8384
/.config

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func main() {
268268
}
269269
}
270270

271-
setupLog.Info("starting manager", "version", caphversion.Get().String())
271+
setupLog.Info("starting manager", "version", caphversion.Get().String(), "args", os.Args)
272272
if err := mgr.Start(ctx); err != nil {
273273
setupLog.Error(err, "problem running manager")
274274
os.Exit(1)

pkg/services/baremetal/client/ssh/ssh_client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,15 @@ func (c *sshClient) GetInstallImageState() (InstallImageState, error) {
430430
}
431431

432432
out = c.runSSH(`[ -e /root/installimage-wrapper.sh.log ]`)
433-
exists, err := out.ExitStatus()
433+
exitStatus, err := out.ExitStatus()
434434
if err != nil {
435435
return "", fmt.Errorf("failed to check if installimage-wrapper.sh.log exists: %w", err)
436436
}
437-
if exists == 0 {
437+
if exitStatus == 0 {
438+
// above log file exists, but installimage is not running: finished.
438439
return InstallImageStateFinished, nil
439440
}
441+
// installimage is not running and the log file does not exist: not started yet.
440442
return InstallImageStateNotStartedYet, nil
441443
}
442444

0 commit comments

Comments
 (0)