Commit a518a273 authored by Eric Tune's avatar Eric Tune

Merge pull request #14417 from soltysh/issue14385

Issue 14385: job's parallelism defaults to completions.
parents 43b37204 a984eb37
...@@ -94,8 +94,7 @@ func addDefaultingFuncs() { ...@@ -94,8 +94,7 @@ func addDefaultingFuncs() {
obj.Spec.Completions = &completions obj.Spec.Completions = &completions
} }
if obj.Spec.Parallelism == nil { if obj.Spec.Parallelism == nil {
parallelism := 2 obj.Spec.Parallelism = obj.Spec.Completions
obj.Spec.Parallelism = &parallelism
} }
}, },
) )
......
...@@ -194,7 +194,7 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -194,7 +194,7 @@ func TestSetDefaultJob(t *testing.T) {
Spec: JobSpec{ Spec: JobSpec{
Selector: map[string]string{"job": "selector"}, Selector: map[string]string{"job": "selector"},
Completions: newInt(1), Completions: newInt(1),
Parallelism: newInt(2), Parallelism: newInt(1),
}, },
} }
tests := []*Job{ tests := []*Job{
...@@ -228,7 +228,7 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -228,7 +228,7 @@ func TestSetDefaultJob(t *testing.T) {
// selector from template labels, completions - default, parallelism set explicitly // selector from template labels, completions - default, parallelism set explicitly
{ {
Spec: JobSpec{ Spec: JobSpec{
Parallelism: newInt(2), Parallelism: newInt(1),
Template: &v1.PodTemplateSpec{ Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{ ObjectMeta: v1.ObjectMeta{
Labels: map[string]string{"job": "selector"}, Labels: map[string]string{"job": "selector"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment