1
0
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:
Darren Shepherd
2018-04-02 15:45:10 -07:00
parent 9f2b71df50
commit 510ed570d2
4 changed files with 57 additions and 2 deletions

View File

@@ -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{