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

@@ -111,7 +111,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
},
},
&api.ReplicationController{},
@@ -152,7 +153,8 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
return rm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return rm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return rm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
},
},
&api.Pod{},