diff --git a/api/doc/controller-schema.json b/api/doc/controller-schema.json index 7baa0eb9445..bec1d9ac1cb 100644 --- a/api/doc/controller-schema.json +++ b/api/doc/controller-schema.json @@ -30,7 +30,7 @@ "required": false, "description": "Number of pods desired in the set" }, - "replicasInSet": { + "replicaSelector": { "type": "object", "required": false, "description": "Required labels used to identify pods in the set" diff --git a/api/examples/controller-list.json b/api/examples/controller-list.json index b2a17950b47..36317709578 100644 --- a/api/examples/controller-list.json +++ b/api/examples/controller-list.json @@ -4,7 +4,7 @@ "id": "testRun", "desiredState": { "replicas": 2, - "replicasInSet": { + "replicaSelector": { "name": "testRun" }, "podTemplate": { diff --git a/api/examples/controller.json b/api/examples/controller.json index c08be4aaaea..8b6da66ca85 100644 --- a/api/examples/controller.json +++ b/api/examples/controller.json @@ -2,7 +2,7 @@ "id": "nginxController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "nginx"}, + "replicaSelector": {"name": "nginx"}, "podTemplate": { "desiredState": { "manifest": { diff --git a/api/kubernetes.html b/api/kubernetes.html index 8678ab0ad0d..b6cfcae98f0 100644 --- a/api/kubernetes.html +++ b/api/kubernetes.html @@ -970,7 +970,7 @@ implemented, either.

"id": "testRun", "desiredState": { "replicas": 2, - "replicasInSet": { + "replicaSelector": { "name": "testRun" }, "podTemplate": { @@ -1074,7 +1074,7 @@ implemented, either.

"required": false, "description": "Number of pods desired in the set" }
, - "replicasInSet": { + "replicaSelector": { "type": "object", "required": false, "description": "Required labels used to identify pods in the set" @@ -1100,7 +1100,7 @@ implemented, either.

"id": "nginxController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "nginx"}, + "replicaSelector": {"name": "nginx"}, "podTemplate": { "desiredState": { "manifest": { @@ -1231,7 +1231,7 @@ implemented, either.

"id": "nginxController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "nginx"}, + "replicaSelector": {"name": "nginx"}, "podTemplate": { "desiredState": { "manifest": { @@ -1333,7 +1333,7 @@ implemented, either.

"required": false, "description": "Number of pods desired in the set" }
, - "replicasInSet": { + "replicaSelector": { "type": "object", "required": false, "description": "Required labels used to identify pods in the set" @@ -1359,7 +1359,7 @@ implemented, either.

"id": "nginxController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "nginx"}, + "replicaSelector": {"name": "nginx"}, "podTemplate": { "desiredState": { "manifest": { diff --git a/examples/guestbook/frontend-controller.json b/examples/guestbook/frontend-controller.json index f3c94ea496d..e7caab32ace 100644 --- a/examples/guestbook/frontend-controller.json +++ b/examples/guestbook/frontend-controller.json @@ -2,7 +2,7 @@ "id": "frontendController", "desiredState": { "replicas": 1, - "replicasInSet": {"name": "frontend"}, + "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { diff --git a/examples/guestbook/guestbook.md b/examples/guestbook/guestbook.md index 77b8c01c852..53d50517549 100644 --- a/examples/guestbook/guestbook.md +++ b/examples/guestbook/guestbook.md @@ -108,7 +108,7 @@ Create a file named `redis-slave-controller.json` that contains: "id": "redisSlaveController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "redis-slave"}, + "replicaSelector": {"name": "redis-slave"}, "podTemplate": { "desiredState": { "manifest": { @@ -191,7 +191,7 @@ Create a file named `frontend-controller.json`: "id": "frontendController", "desiredState": { "replicas": 3, - "replicasInSet": {"name": "frontend"}, + "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { diff --git a/examples/guestbook/redis-slave-controller.json b/examples/guestbook/redis-slave-controller.json index ee6a31e0dac..d4d38117c25 100644 --- a/examples/guestbook/redis-slave-controller.json +++ b/examples/guestbook/redis-slave-controller.json @@ -2,7 +2,7 @@ "id": "redisSlaveController", "desiredState": { "replicas": 2, - "replicasInSet": {"name": "redisslave"}, + "replicaSelector": {"name": "redisslave"}, "podTemplate": { "desiredState": { "manifest": { diff --git a/pkg/api/types.go b/pkg/api/types.go index 9fd31f70369..29a71cde7cd 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -108,9 +108,9 @@ type Pod struct { // ReplicationControllerState is the state of a replication controller, either input (create, update) or as output (list, get) type ReplicationControllerState struct { - Replicas int `json:"replicas" yaml:"replicas"` - ReplicasInSet map[string]string `json:"replicasInSet,omitempty" yaml:"replicasInSet,omitempty"` - PodTemplate PodTemplate `json:"podTemplate,omitempty" yaml:"podTemplate,omitempty"` + Replicas int `json:"replicas" yaml:"replicas"` + ReplicaSelector map[string]string `json:"replicaSelector,omitempty" yaml:"replicaSelector,omitempty"` + PodTemplate PodTemplate `json:"podTemplate,omitempty" yaml:"podTemplate,omitempty"` } type ReplicationControllerList struct { diff --git a/pkg/cloudcfg/cloudcfg.go b/pkg/cloudcfg/cloudcfg.go index feb53f284b0..fb097703c7a 100644 --- a/pkg/cloudcfg/cloudcfg.go +++ b/pkg/cloudcfg/cloudcfg.go @@ -74,7 +74,7 @@ func Update(name string, client client.ClientInterface, updatePeriod time.Durati if err != nil { return err } - labels := controller.DesiredState.ReplicasInSet + labels := controller.DesiredState.ReplicaSelector podList, err := client.ListPods(labels) if err != nil { @@ -200,7 +200,7 @@ func RunController(image, name string, replicas int, client client.ClientInterfa }, DesiredState: api.ReplicationControllerState{ Replicas: replicas, - ReplicasInSet: map[string]string{ + ReplicaSelector: map[string]string{ "name": name, }, PodTemplate: api.PodTemplate{ diff --git a/pkg/cloudcfg/resource_printer.go b/pkg/cloudcfg/resource_printer.go index 648e42c7f1a..9368d57d501 100644 --- a/pkg/cloudcfg/resource_printer.go +++ b/pkg/cloudcfg/resource_printer.go @@ -107,7 +107,7 @@ func (h *HumanReadablePrinter) printPodList(podList api.PodList, w io.Writer) er func (h *HumanReadablePrinter) printReplicationController(ctrl api.ReplicationController, w io.Writer) error { _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%d\n", - ctrl.ID, h.makeImageList(ctrl.DesiredState.PodTemplate.DesiredState.Manifest), labels.Set(ctrl.DesiredState.ReplicasInSet), ctrl.DesiredState.Replicas) + ctrl.ID, h.makeImageList(ctrl.DesiredState.PodTemplate.DesiredState.Manifest), labels.Set(ctrl.DesiredState.ReplicaSelector), ctrl.DesiredState.Replicas) return err } diff --git a/pkg/controller/replication_controller.go b/pkg/controller/replication_controller.go index 35f6499b9c9..a3876f2d48c 100644 --- a/pkg/controller/replication_controller.go +++ b/pkg/controller/replication_controller.go @@ -177,7 +177,7 @@ func (rm *ReplicationManager) filterActivePods(pods []api.Pod) []api.Pod { } func (rm *ReplicationManager) syncReplicationController(controllerSpec api.ReplicationController) error { - podList, err := rm.kubeClient.ListPods(controllerSpec.DesiredState.ReplicasInSet) + podList, err := rm.kubeClient.ListPods(controllerSpec.DesiredState.ReplicaSelector) if err != nil { return err } diff --git a/pkg/registry/controller_registry_test.go b/pkg/registry/controller_registry_test.go index 14eac7e4986..8d2257ec0d5 100644 --- a/pkg/registry/controller_registry_test.go +++ b/pkg/registry/controller_registry_test.go @@ -139,7 +139,7 @@ func TestControllerParsing(t *testing.T) { }, DesiredState: api.ReplicationControllerState{ Replicas: 2, - ReplicasInSet: map[string]string{ + ReplicaSelector: map[string]string{ "name": "nginx", }, PodTemplate: api.PodTemplate{