Support timeout in watch requests
This commit is contained in:
@@ -631,3 +631,12 @@ func DefaultKubernetesUserAgent() string {
|
||||
version = seg[0]
|
||||
return fmt.Sprintf("%s/%s (%s/%s) kubernetes/%s", path.Base(os.Args[0]), version, gruntime.GOOS, gruntime.GOARCH, commit)
|
||||
}
|
||||
|
||||
// TimeoutFromListOptions returns timeout to be set via TimeoutSeconds() method
|
||||
// based on given options.
|
||||
func TimeoutFromListOptions(options api.ListOptions) time.Duration {
|
||||
if options.TimeoutSeconds != nil {
|
||||
return time.Duration(*options.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user