fix Cronjob status.lastSuccessfulTime not populated by a manually triggered job
Kubernetes-commit: f2a64cb91d7cf7216db60c2e1c8b1e530c85f94f
This commit is contained in:
parent
4c5998d8fa
commit
f4c3a1c36a
|
|
@ -264,14 +264,7 @@ func (o *CreateJobOptions) createJobFromCronJob(cronJob *batchv1.CronJob) *batch
|
||||||
Name: o.Name,
|
Name: o.Name,
|
||||||
Annotations: annotations,
|
Annotations: annotations,
|
||||||
Labels: cronJob.Spec.JobTemplate.Labels,
|
Labels: cronJob.Spec.JobTemplate.Labels,
|
||||||
OwnerReferences: []metav1.OwnerReference{
|
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cronJob, batchv1.SchemeGroupVersion.WithKind("CronJob"))},
|
||||||
{
|
|
||||||
APIVersion: batchv1.SchemeGroupVersion.String(),
|
|
||||||
Kind: "CronJob",
|
|
||||||
Name: cronJob.GetName(),
|
|
||||||
UID: cronJob.GetUID(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Spec: cronJob.Spec.JobTemplate.Spec,
|
Spec: cronJob.Spec.JobTemplate.Spec,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,14 +163,7 @@ func TestCreateJobFromCronJob(t *testing.T) {
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: jobName,
|
Name: jobName,
|
||||||
Annotations: map[string]string{"cronjob.kubernetes.io/instantiate": "manual"},
|
Annotations: map[string]string{"cronjob.kubernetes.io/instantiate": "manual"},
|
||||||
OwnerReferences: []metav1.OwnerReference{
|
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cronJob, batchv1.SchemeGroupVersion.WithKind("CronJob"))},
|
||||||
{
|
|
||||||
APIVersion: batchv1.SchemeGroupVersion.String(),
|
|
||||||
Kind: "CronJob",
|
|
||||||
Name: cronJob.GetName(),
|
|
||||||
UID: cronJob.GetUID(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Spec: batchv1.JobSpec{
|
Spec: batchv1.JobSpec{
|
||||||
Template: corev1.PodTemplateSpec{
|
Template: corev1.PodTemplateSpec{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue