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

@@ -36,7 +36,7 @@ type NodeInterface interface {
Delete(name string) error
Update(*api.Node) (*api.Node, error)
UpdateStatus(*api.Node) (*api.Node, error)
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)
}
// nodes implements NodesInterface
@@ -102,12 +102,12 @@ func (c *nodes) UpdateStatus(node *api.Node) (*api.Node, error) {
}
// Watch returns a watch.Interface that watches the requested nodes.
func (c *nodes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
func (c *nodes) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error) {
return c.r.Get().
Prefix("watch").
Namespace(api.NamespaceAll).
Resource(c.resourceName()).
Param("resourceVersion", resourceVersion).
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label).
FieldsSelectorParam(field).
Watch()