mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add a validation that replicaSelector matches PodTemplate.Labels
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user