mirror of
https://github.com/rancher/norman.git
synced 2025-09-24 20:48:18 +00:00
Add timeouts to rest clients
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rancher/norman/restwatch"
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
"github.com/rancher/norman/types/values"
|
||||
@@ -187,6 +188,10 @@ func (p *Store) Watch(apiContext *types.APIContext, schema *types.Schema, opt *t
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if watchClient, ok := k8sClient.(restwatch.WatchClient); ok {
|
||||
k8sClient = watchClient.WatchClient()
|
||||
}
|
||||
|
||||
timeout := int64(60 * 60)
|
||||
req := p.common(namespace, k8sClient.Get())
|
||||
req.VersionedParams(&metav1.ListOptions{
|
||||
|
Reference in New Issue
Block a user