mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Set Job's labels from PodTemplateSpec if none are specified
This commit is contained in:
@@ -39,4 +39,8 @@ func SetDefaults_Job(obj *Job) {
|
||||
obj.Spec.Parallelism = new(int32)
|
||||
*obj.Spec.Parallelism = 1
|
||||
}
|
||||
labels := obj.Spec.Template.Labels
|
||||
if labels != nil && len(obj.Labels) == 0 {
|
||||
obj.Labels = labels
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user