Commit 2d881ca1 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #33536 from hongchaodeng/revert-33101-etcd_fix

Automatic merge from submit-queue Revert "Work around the etcd watch issue" Reverts kubernetes/kubernetes#33101 Since #33393 is merged, the bug should have been fixed.
parents 390cf0aa 078f2d6b
...@@ -34,8 +34,6 @@ import ( ...@@ -34,8 +34,6 @@ import (
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
"golang.org/x/net/context"
) )
type Tester struct { type Tester struct {
...@@ -1235,7 +1233,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass ...@@ -1235,7 +1233,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass
for _, field := range fieldsPass { for _, field := range fieldsPass {
for _, action := range actions { for _, action := range actions {
options := &api.ListOptions{FieldSelector: field.AsSelector(), ResourceVersion: "1"} 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) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v, %v", err, action) t.Errorf("unexpected error: %v, %v", err, action)
...@@ -1260,7 +1257,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass ...@@ -1260,7 +1257,6 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass
for _, field := range fieldsFail { for _, field := range fieldsFail {
for _, action := range actions { for _, action := range actions {
options := &api.ListOptions{FieldSelector: field.AsSelector(), ResourceVersion: "1"} 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) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
...@@ -1281,12 +1277,11 @@ func (t *Tester) testWatchFields(obj runtime.Object, emitFn EmitFunc, fieldsPass ...@@ -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) { 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 _, label := range labelsPass {
for _, action := range actions { for _, action := range actions {
options := &api.ListOptions{LabelSelector: label.AsSelector(), ResourceVersion: "1"} 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) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
...@@ -1310,7 +1305,6 @@ func (t *Tester) testWatchLabels(obj runtime.Object, emitFn EmitFunc, labelsPass ...@@ -1310,7 +1305,6 @@ func (t *Tester) testWatchLabels(obj runtime.Object, emitFn EmitFunc, labelsPass
for _, label := range labelsFail { for _, label := range labelsFail {
for _, action := range actions { for _, action := range actions {
options := &api.ListOptions{LabelSelector: label.AsSelector(), ResourceVersion: "1"} 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) watcher, err := t.storage.(rest.Watcher).Watch(ctx, options)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment