Use ListOptions when listing RCs in deployment

This commit is contained in:
Janet Kuo
2016-01-29 17:23:22 -08:00
parent c84a0371a2
commit 42f712467e
4 changed files with 10 additions and 9 deletions

View File

@@ -170,11 +170,13 @@ type storeReplicationControllersNamespacer struct {
namespace string
}
func (s storeReplicationControllersNamespacer) List() (controllers []api.ReplicationController, err error) {
func (s storeReplicationControllersNamespacer) List(selector labels.Selector) (controllers []api.ReplicationController, err error) {
for _, c := range s.store.List() {
rc := *(c.(*api.ReplicationController))
if s.namespace == api.NamespaceAll || s.namespace == rc.Namespace {
controllers = append(controllers, rc)
if selector.Matches(labels.Set(rc.Labels)) {
controllers = append(controllers, rc)
}
}
}
return