Avoid populating job selector from pod template labels in autoSelector case

This commit is contained in:
Jordan Liggitt
2016-03-16 02:23:01 -04:00
parent 49092c0b99
commit 64f51723c8
3 changed files with 106 additions and 31 deletions

View File

@@ -980,7 +980,7 @@ func TestValidateJob(t *testing.T) {
MatchLabels: map[string]string{"a": "b"},
}
validGeneratedSelector := &unversioned.LabelSelector{
MatchLabels: map[string]string{"collection-uid": "1a2b3c"},
MatchLabels: map[string]string{"controller-uid": "1a2b3c", "job-name": "myjob"},
}
validPodTemplateSpecForManual := api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
@@ -1023,7 +1023,7 @@ func TestValidateJob(t *testing.T) {
},
Spec: extensions.JobSpec{
Selector: validGeneratedSelector,
ManualSelector: newBool(true),
ManualSelector: newBool(false),
Template: validPodTemplateSpecForGenerated,
},
},