mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
Issue 14385: job's parallelism defaults to completions.
This commit is contained in:
parent
28585bc699
commit
a984eb3760
@ -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 = ¶llelism
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -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) {
|
|||||||
// 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"},
|
||||||
|
Loading…
Reference in New Issue
Block a user