Simplify Watch() signature in clients.

This commit is contained in:
Wojciech Tyczynski
2015-11-26 16:27:45 +01:00
parent ea14d1c309
commit d2dfc912e6
77 changed files with 172 additions and 183 deletions

View File

@@ -34,7 +34,7 @@ type SecretsInterface interface {
Delete(name string) error
List(label labels.Selector, field fields.Selector) (*api.SecretList, error)
Get(name string) (*api.Secret, error)
Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error)
Watch(opts unversioned.ListOptions) (watch.Interface, error)
}
// events implements Secrets interface
@@ -92,14 +92,12 @@ func (s *secrets) Get(name string) (*api.Secret, error) {
}
// Watch starts watching for secrets matching the given selectors.
func (s *secrets) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) {
func (s *secrets) Watch(opts unversioned.ListOptions) (watch.Interface, error) {
return s.client.Get().
Prefix("watch").
Namespace(s.namespace).
Resource("secrets").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label).
FieldsSelectorParam(field).
Watch()
}