Add a validation that replicaSelector matches PodTemplate.Labels

This commit is contained in:
Brendan Burns
2014-08-21 17:02:39 -07:00
parent 1c68247954
commit 5839378adc
3 changed files with 14 additions and 0 deletions

View File

@@ -373,6 +373,7 @@ func TestValidateReplicationController(t *testing.T) {
Version: "v1beta1",
},
},
Labels: validSelector,
}
successCases := []ReplicationController{
@@ -411,6 +412,13 @@ func TestValidateReplicationController(t *testing.T) {
PodTemplate: validPodTemplate,
},
},
"selector_doesnt_match": {
JSONBase: JSONBase{ID: "abc"},
DesiredState: ReplicationControllerState{
ReplicaSelector: map[string]string{"foo": "bar"},
PodTemplate: validPodTemplate,
},
},
"invalid manifest": {
JSONBase: JSONBase{ID: "abc"},
DesiredState: ReplicationControllerState{