Rename ReplicasInSet to ReplicaSelector
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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{
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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{
|
||||
|
Reference in New Issue
Block a user