published by bot

(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 124fb610dcbd445fa710da67508ac6d5b822f61d
This commit is contained in:
Kubernetes Publisher
2016-11-24 08:15:51 +00:00
parent ecd05810bd
commit 5d8c36c93c
241 changed files with 5806 additions and 3601 deletions

View File

@@ -21,6 +21,7 @@ import (
"testing"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/watch"
)
@@ -33,7 +34,7 @@ func consume(t *testing.T, w watch.Interface, rvs []string, done *sync.WaitGroup
t.Errorf("%#v: unexpected channel close, wanted %v", rvs, rv)
return
}
gotRV := got.Object.(*api.Pod).ObjectMeta.ResourceVersion
gotRV := got.Object.(*v1.Pod).ObjectMeta.ResourceVersion
if e, a := rv, gotRV; e != a {
t.Errorf("wanted %v, got %v", e, a)
} else {
@@ -48,9 +49,9 @@ func consume(t *testing.T, w watch.Interface, rvs []string, done *sync.WaitGroup
}
func TestRCNumber(t *testing.T) {
pod := func(name string) *api.Pod {
return &api.Pod{
ObjectMeta: api.ObjectMeta{
pod := func(name string) *v1.Pod {
return &v1.Pod{
ObjectMeta: v1.ObjectMeta{
Name: name,
},
}
@@ -64,13 +65,13 @@ func TestRCNumber(t *testing.T) {
source.Modify(pod("foo"))
source.Modify(pod("foo"))
w, err := source.Watch(api.ListOptions{ResourceVersion: "1"})
w, err := source.Watch(v1.ListOptions{ResourceVersion: "1"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
go consume(t, w, []string{"2", "3"}, wg)
list, err := source.List(api.ListOptions{})
list, err := source.List(v1.ListOptions{})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
@@ -78,13 +79,13 @@ func TestRCNumber(t *testing.T) {
t.Errorf("wanted %v, got %v", e, a)
}
w2, err := source.Watch(api.ListOptions{ResourceVersion: "2"})
w2, err := source.Watch(v1.ListOptions{ResourceVersion: "2"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
go consume(t, w2, []string{"3"}, wg)
w3, err := source.Watch(api.ListOptions{ResourceVersion: "3"})
w3, err := source.Watch(v1.ListOptions{ResourceVersion: "3"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}