diff --git a/pkg/master/master.go b/pkg/master/master.go index 8d88769b850..a201aa0dbdb 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -41,6 +41,8 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/auth/handlers" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider" + "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" + "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports" controlleretcd "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller/etcd" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint" @@ -567,7 +569,7 @@ func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server { } serversToValidate[fmt.Sprintf("etcd-%d", ix)] = apiserver.Server{Addr: addr, Port: port, Path: "/v2/keys/"} } - nodes, err := m.nodeRegistry.ListMinions(api.NewDefaultContext()) + nodes, err := m.nodeRegistry.ListMinions(api.NewDefaultContext(), labels.Everything(), fields.Everything()) if err != nil { glog.Errorf("Failed to list minions: %v", err) } diff --git a/pkg/registry/minion/registry.go b/pkg/registry/minion/registry.go index f4438332da8..182c9aae6fa 100644 --- a/pkg/registry/minion/registry.go +++ b/pkg/registry/minion/registry.go @@ -26,7 +26,7 @@ import ( // Registry is an interface for things that know how to store node. type Registry interface { - ListMinions(ctx api.Context) (*api.NodeList, error) + ListMinions(ctx api.Context, label labels.Selector, field fields.Selector) (*api.NodeList, error) CreateMinion(ctx api.Context, minion *api.Node) error UpdateMinion(ctx api.Context, minion *api.Node) error GetMinion(ctx api.Context, minionID string) (*api.Node, error) @@ -45,8 +45,8 @@ func NewRegistry(s rest.StandardStorage) Registry { return &storage{s} } -func (s *storage) ListMinions(ctx api.Context) (*api.NodeList, error) { - obj, err := s.List(ctx, labels.Everything(), fields.Everything()) +func (s *storage) ListMinions(ctx api.Context, label labels.Selector, field fields.Selector) (*api.NodeList, error) { + obj, err := s.List(ctx, label, field) if err != nil { return nil, err } diff --git a/pkg/registry/pod/registry.go b/pkg/registry/pod/registry.go index 4be48ab56e9..5434d640b97 100644 --- a/pkg/registry/pod/registry.go +++ b/pkg/registry/pod/registry.go @@ -27,7 +27,7 @@ import ( // Registry is an interface implemented by things that know how to store Pod objects. type Registry interface { // ListPods obtains a list of pods having labels which match selector. - ListPods(ctx api.Context, selector labels.Selector) (*api.PodList, error) + ListPods(ctx api.Context, label labels.Selector) (*api.PodList, error) // Watch for new/changed/deleted pods WatchPods(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) // Get a specific pod diff --git a/pkg/registry/registrytest/minion.go b/pkg/registry/registrytest/minion.go index 5094e991ba0..08dcd1b3dc4 100644 --- a/pkg/registry/registrytest/minion.go +++ b/pkg/registry/registrytest/minion.go @@ -59,7 +59,7 @@ func (r *MinionRegistry) SetError(err error) { r.Err = err } -func (r *MinionRegistry) ListMinions(ctx api.Context) (*api.NodeList, error) { +func (r *MinionRegistry) ListMinions(ctx api.Context, label labels.Selector, field fields.Selector) (*api.NodeList, error) { r.Lock() defer r.Unlock() return &r.Minions, r.Err diff --git a/pkg/registry/service/rest.go b/pkg/registry/service/rest.go index 8fd79d0003a..8f76deb7c43 100644 --- a/pkg/registry/service/rest.go +++ b/pkg/registry/service/rest.go @@ -295,7 +295,7 @@ func (rs *REST) createExternalLoadBalancer(ctx api.Context, service *api.Service if !ok { return fmt.Errorf("the cloud provider does not support zone enumeration.") } - hosts, err := rs.machines.ListMinions(ctx) + hosts, err := rs.machines.ListMinions(ctx, labels.Everything(), fields.Everything()) if err != nil { return err }