From 078f2d6be9792205bd89139e5c7a8397b8a05886 Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Mon, 26 Sep 2016 23:54:10 -0700 Subject: [PATCH] Revert "Work around the etcd watch issue" --- pkg/api/rest/resttest/resttest.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/api/rest/resttest/resttest.go b/pkg/api/rest/resttest/resttest.go index c04567636f..fe8ab7ad87 100644 --- a/pkg/api/rest/resttest/resttest.go +++ b/pkg/api/rest/resttest/resttest.go @@ -34,8 +34,6 @@ import ( "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/wait" - - "golang.org/x/net/context" ) type Tester struct { @@ -1235,7 +1233,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass for _, field := range fieldsPass { for _, action := range actions { options := &api.ListOptions{FieldSelector: field.AsSelector(), ResourceVersion: "1"} - ctx = context.WithValue(context.WithValue(ctx, "field", field), "action", action) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options) if err != nil { t.Errorf("unexpected error: %v, %v", err, action) @@ -1260,7 +1257,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass for _, field := range fieldsFail { for _, action := range actions { options := &api.ListOptions{FieldSelector: field.AsSelector(), ResourceVersion: "1"} - ctx = context.WithValue(context.WithValue(ctx, "field", field), "action", action) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options) if err != nil { t.Errorf("unexpected error: %v", err) @@ -1281,12 +1277,11 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass } func (t *Tester) testWatchLabels(obj runtime.Object, emitFn EmitFunc, labelsPass, labelsFail []labels.Set, actions []string) { - ctx := t.TestContext().(context.Context) + ctx := t.TestContext() for _, label := range labelsPass { for _, action := range actions { options := &api.ListOptions{LabelSelector: label.AsSelector(), ResourceVersion: "1"} - ctx = context.WithValue(context.WithValue(ctx, "label", label), "action", action) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options) if err != nil { t.Errorf("unexpected error: %v", err) @@ -1310,7 +1305,6 @@ func (t *Tester) testWatchLabels(obj runtime.Object, emitFn EmitFunc, labelsPass for _, label := range labelsFail { for _, action := range actions { options := &api.ListOptions{LabelSelector: label.AsSelector(), ResourceVersion: "1"} - ctx = context.WithValue(context.WithValue(ctx, "label", label), "action", action) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options) if err != nil { t.Errorf("unexpected error: %v", err)