mirror of https://github.com/k3s-io/k3s
Merge pull request #14417 from soltysh/issue14385
Issue 14385: job's parallelism defaults to completions.pull/6/head
commit
a518a27354
|
@ -94,8 +94,7 @@ func addDefaultingFuncs() {
|
|||
obj.Spec.Completions = &completions
|
||||
}
|
||||
if obj.Spec.Parallelism == nil {
|
||||
parallelism := 2
|
||||
obj.Spec.Parallelism = ¶llelism
|
||||
obj.Spec.Parallelism = obj.Spec.Completions
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
@ -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"},
|
||||
|
|
Loading…
Reference in New Issue