Support timeout in watch requests

This commit is contained in:
Wojciech Tyczynski
2015-10-16 15:07:14 +02:00
parent 40b6f1cc28
commit f4d75e0a0a
85 changed files with 256 additions and 160 deletions

View File

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