populate last successful time to cronjob status

This commit is contained in:
Alay Patel
2021-06-06 12:17:34 -04:00
parent 9d27400fe2
commit 92b52a4fb5
3 changed files with 28 additions and 7 deletions

View File

@@ -267,10 +267,11 @@ func getJobFromTemplate2(cj *batchv1.CronJob, scheduledTime time.Time) (*batchv1
job := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Annotations: annotations,
Name: name,
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cj, controllerKind)},
Labels: labels,
Annotations: annotations,
Name: name,
CreationTimestamp: metav1.Time{Time: scheduledTime},
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cj, controllerKind)},
},
}
cj.Spec.JobTemplate.Spec.DeepCopyInto(&job.Spec)