Skip to content

Commit

Permalink
Fix default watchdog timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Sluiter <[email protected]>
  • Loading branch information
slintes committed Jun 17, 2024
1 parent dd94530 commit bf6ffbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/utils/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ func IsSoftwareRebootEnabled() (bool, error) {
}

func GetWatchdogTimeout(node *v1.Node) time.Duration {
// 60s is the maximum default timeout according to https://docs.kernel.org/watchdog/watchdog-parameters.html
defaultTimeout := 60 * time.Second
if node.Annotations == nil {
return 0
return defaultTimeout
}

timeout, err := strconv.Atoi(node.Annotations[WatchdogTimeoutSecondsAnnotation])
if err != nil {
return 0
return defaultTimeout
}

return time.Duration(timeout) * time.Second
Expand Down

0 comments on commit bf6ffbe

Please sign in to comment.