mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Support timeout in watch requests
This commit is contained in:
@@ -167,7 +167,8 @@ func NewNodeController(
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything())
|
||||
},
|
||||
WatchFunc: func(rv string) (watch.Interface, error) {
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv)
|
||||
options := api.ListOptions{ResourceVersion: rv}
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
|
||||
},
|
||||
},
|
||||
&api.Pod{},
|
||||
@@ -183,7 +184,8 @@ func NewNodeController(
|
||||
return nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything())
|
||||
},
|
||||
WatchFunc: func(rv string) (watch.Interface, error) {
|
||||
return nc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), rv)
|
||||
options := api.ListOptions{ResourceVersion: rv}
|
||||
return nc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options)
|
||||
},
|
||||
},
|
||||
&api.Node{},
|
||||
|
||||
@@ -137,7 +137,7 @@ func (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error) {
|
||||
return node, nil
|
||||
}
|
||||
|
||||
func (m *FakeNodeHandler) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
func (m *FakeNodeHandler) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user