Add context object in test cases flows

This commit is contained in:
derekwaynecarr
2014-09-25 14:35:10 -04:00
parent 3e685674e7
commit be85ad7a3d
9 changed files with 108 additions and 65 deletions

View File

@@ -22,6 +22,8 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
"code.google.com/p/go.net/context"
)
type PodRegistry struct {
@@ -57,7 +59,7 @@ func (r *PodRegistry) ListPodsPredicate(filter func(*api.Pod) bool) (*api.PodLis
return &pods, nil
}
func (r *PodRegistry) ListPods(selector labels.Selector) (*api.PodList, error) {
func (r *PodRegistry) ListPods(ctx context.Context, selector labels.Selector) (*api.PodList, error) {
return r.ListPodsPredicate(func(pod *api.Pod) bool {
return selector.Matches(labels.Set(pod.Labels))
})