Merge pull request #14417 from soltysh/issue14385

Issue 14385: job's parallelism defaults to completions.
pull/6/head
Eric Tune 2015-09-24 14:25:22 -07:00
commit a518a27354
2 changed files with 3 additions and 4 deletions

View File

@ -94,8 +94,7 @@ func addDefaultingFuncs() {
obj.Spec.Completions = &completions
}
if obj.Spec.Parallelism == nil {
parallelism := 2
obj.Spec.Parallelism = &parallelism
obj.Spec.Parallelism = obj.Spec.Completions
}
},
)

View File

@ -194,7 +194,7 @@ func TestSetDefaultJob(t *testing.T) {
Spec: JobSpec{
Selector: map[string]string{"job": "selector"},
Completions: newInt(1),
Parallelism: newInt(2),
Parallelism: newInt(1),
},
}
tests := []*Job{
@ -228,7 +228,7 @@ func TestSetDefaultJob(t *testing.T) {
// selector from template labels, completions - default, parallelism set explicitly
{
Spec: JobSpec{
Parallelism: newInt(2),
Parallelism: newInt(1),
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
Labels: map[string]string{"job": "selector"},