Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase default timeout on Windows #1058

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmd/crictl/main.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main
import (
"fmt"
"os"
"runtime"
"sort"
"time"

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

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

var (
// RuntimeEndpoint is CRI server runtime endpoint
@@ -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
@@ -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
}