Update guestbook example to use replication controller.

This commit is contained in:
rsokolowski
2015-02-06 00:20:27 +01:00
parent e77322a561
commit 635281ebe3
15 changed files with 315 additions and 264 deletions

View File

@@ -34,7 +34,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch/json"
)
func testData() (*api.PodList, *api.ServiceList) {
func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList) {
pods := &api.PodList{
ListMeta: api.ListMeta{
ResourceVersion: "15",
@@ -70,7 +70,20 @@ func testData() (*api.PodList, *api.ServiceList) {
},
},
}
return pods, svc
rc := &api.ReplicationControllerList{
ListMeta: api.ListMeta{
ResourceVersion: "17",
},
Items: []api.ReplicationController{
{
ObjectMeta: api.ObjectMeta{Name: "rc1", Namespace: "test", ResourceVersion: "18"},
Spec: api.ReplicationControllerSpec{
Replicas: 1,
},
},
},
}
return pods, svc, rc
}
// Verifies that schemas that are not in the master tree of Kubernetes can be retrieved via Get.
@@ -123,7 +136,7 @@ func TestGetSchemaObject(t *testing.T) {
}
func TestGetObjects(t *testing.T) {
pods, _ := testData()
pods, _, _ := testData()
f, tf, codec := NewAPIFactory()
tf.Printer = &testPrinter{}
@@ -149,7 +162,7 @@ func TestGetObjects(t *testing.T) {
}
func TestGetListObjects(t *testing.T) {
pods, _ := testData()
pods, _, _ := testData()
f, tf, codec := NewAPIFactory()
tf.Printer = &testPrinter{}
@@ -175,7 +188,7 @@ func TestGetListObjects(t *testing.T) {
}
func TestGetMultipleTypeObjects(t *testing.T) {
pods, svc := testData()
pods, svc, _ := testData()
f, tf, codec := NewAPIFactory()
tf.Printer = &testPrinter{}
@@ -211,7 +224,7 @@ func TestGetMultipleTypeObjects(t *testing.T) {
}
func TestGetMultipleTypeObjectsAsList(t *testing.T) {
pods, svc := testData()
pods, svc, _ := testData()
f, tf, codec := NewAPIFactory()
tf.Printer = &testPrinter{}
@@ -260,7 +273,7 @@ func TestGetMultipleTypeObjectsAsList(t *testing.T) {
}
func TestGetMultipleTypeObjectsWithSelector(t *testing.T) {
pods, svc := testData()
pods, svc, _ := testData()
f, tf, codec := NewAPIFactory()
tf.Printer = &testPrinter{}