Skip to content

Commit

Permalink
fix cronjob status.lastSuccessfulTime not populated by a manually tri…
Browse files Browse the repository at this point in the history
…ggered job (#9881)
  • Loading branch information
avanish23 authored Jan 24, 2025
1 parent 3e47336 commit 38e970c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions modules/api/pkg/resource/cronjob/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,11 @@ func TriggerCronJob(client client.Interface,

jobToCreate := &batch.Job{
ObjectMeta: meta.ObjectMeta{
Name: newJobName,
Namespace: namespace,
Annotations: annotations,
Labels: labels,
OwnerReferences: []meta.OwnerReference{{
APIVersion: CronJobAPIVersion,
Kind: CronJobKindName,
Name: cronJob.Name,
UID: cronJob.UID,
}},
Name: newJobName,
Namespace: namespace,
Annotations: annotations,
Labels: labels,
OwnerReferences: []meta.OwnerReference{*meta.NewControllerRef(cronJob, batch.SchemeGroupVersion.WithKind("CronJob"))},
},
Spec: cronJob.Spec.JobTemplate.Spec,
}
Expand Down

0 comments on commit 38e970c

Please sign in to comment.