mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Set Job's labels from PodTemplateSpec if none are specified
This commit is contained in:
@@ -40,6 +40,10 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ScheduledJob(obj *ScheduledJob) {
|
||||
|
||||
Reference in New Issue
Block a user