Default replica controller nodeSelector using pod template.

Add default labels from pod if not present.
This commit is contained in:
Brendan Burns
2015-04-08 22:13:59 -07:00
parent e44ec497ed
commit fded23a777
9 changed files with 341 additions and 5 deletions

View File

@@ -333,6 +333,10 @@ func TestControllerUpdateReplicas(t *testing.T) {
// Status.Replicas should go up from 2->4 even though we created 5-4=1 pod
rc.Status = api.ReplicationControllerStatus{Replicas: 4}
// These are set by default.
rc.Spec.Selector = rc.Spec.Template.Labels
rc.Labels = rc.Spec.Template.Labels
decRc := runtime.EncodeOrDie(testapi.Codec(), &rc)
fakeUpdateHandler.ValidateRequest(t, testapi.ResourcePathWithQueryParams(replicationControllerResourceName(), rc.Namespace, rc.Name), "PUT", &decRc)
validateSyncReplication(t, &fakePodControl, 1, 0)