mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Simplify Watch() signature in clients.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user