Skip to content

Commit

Permalink
Increase defualt timeout on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <[email protected]>
  • Loading branch information
jsturtevant committed Jan 6, 2023
1 parent 0e32cef commit aa036b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"fmt"
"os"
"runtime"
"sort"
"time"

Expand All @@ -34,6 +35,7 @@ import (
)

const defaultTimeout = 2 * time.Second
const defaultTimeoutWindows = 200 * time.Second

var (
// RuntimeEndpoint is CRI server runtime endpoint
Expand All @@ -44,7 +46,7 @@ var (
ImageEndpoint string
// ImageEndpointIsSet is true when ImageEndpoint is configured
ImageEndpointIsSet bool
// Timeout of connecting to server (default: 10s)
// Timeout of connecting to server (default: 2s on Linux, 200s on Windows)
Timeout time.Duration
// Debug enable debug output
Debug bool
Expand Down Expand Up @@ -135,6 +137,11 @@ func getTimeout(timeDuration time.Duration) time.Duration {
if timeDuration.Seconds() > 0 {
return timeDuration
}

if runtime.GOOS == "windows" {
return defaultTimeoutWindows
}

return defaultTimeout // use default
}

Expand Down

0 comments on commit aa036b5

Please sign in to comment.