mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Simplify List() signature in clients.
This commit is contained in:
@@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@@ -32,7 +30,7 @@ type ServiceAccountsInterface interface {
|
||||
Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
|
||||
Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
|
||||
Delete(name string) error
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ServiceAccountList, error)
|
||||
Get(name string) (*api.ServiceAccount, error)
|
||||
Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
@@ -64,15 +62,13 @@ func (s *serviceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.Servi
|
||||
}
|
||||
|
||||
// List returns a list of serviceAccounts matching the selectors.
|
||||
func (s *serviceAccounts) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
func (s *serviceAccounts) List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
result := &api.ServiceAccountList{}
|
||||
|
||||
err := s.client.Get().
|
||||
Namespace(s.namespace).
|
||||
Resource("serviceAccounts").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user