Move watch filter into storage level

This commit is contained in:
Deyuan Deng
2014-11-28 17:28:42 -05:00
parent 2261c3e71c
commit 76552423f9
8 changed files with 250 additions and 51 deletions

View File

@@ -18,6 +18,7 @@ package registrytest
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)
@@ -47,6 +48,6 @@ func (r *ControllerRegistry) DeleteController(ctx api.Context, ID string) error
return r.Err
}
func (r *ControllerRegistry) WatchControllers(ctx api.Context, resourceVersion string) (watch.Interface, error) {
func (r *ControllerRegistry) WatchControllers(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
return nil, r.Err
}

View File

@@ -63,9 +63,9 @@ func (r *PodRegistry) ListPods(ctx api.Context, selector labels.Selector) (*api.
})
}
func (r *PodRegistry) WatchPods(ctx api.Context, resourceVersion string, filter func(*api.Pod) bool) (watch.Interface, error) {
// TODO: wire filter down into the broadcaster; it needs access to current and previous state :(
func (r *PodRegistry) WatchPods(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
return r.broadcaster.Watch(), nil
}
func (r *PodRegistry) GetPod(ctx api.Context, podId string) (*api.Pod, error) {