Skip to content

Commit 98906ed

Browse files
committed
fix: use reboot delay only in case of error
Delay the reboot for 10 seconds only if Talos hits an error, but otherwise just proceed with the requested action. This removes 10 seconds on "regular" reboot without kexec. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 05fd042 commit 98906ed

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

internal/app/machined/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ func handle(ctx context.Context, err error) {
118118
rebootCmd = 0
119119
}
120120
}
121-
}
122121

123-
if rebootCmd == unix.LINUX_REBOOT_CMD_RESTART {
124-
for i := 10; i >= 0; i-- {
125-
log.Printf("rebooting in %d seconds\n", i)
126-
time.Sleep(1 * time.Second)
122+
if rebootCmd == unix.LINUX_REBOOT_CMD_RESTART {
123+
for i := 10; i >= 0; i-- {
124+
log.Printf("rebooting in %d seconds\n", i)
125+
time.Sleep(1 * time.Second)
126+
}
127127
}
128128
}
129129

0 commit comments

Comments
 (0)