Skip to content

Commit

Permalink
Fix panic when calling UpdateStatus if LastTransitionTime no set
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxuzhonghu authored and k82cn committed Jul 2, 2020
1 parent 99f934b commit 948e709
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controllers/job/job_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ func (cc *Controller) initJobStatus(job *batch.Job) (*batch.Job, error) {

job.Status.State.LastTransitionTime = metav1.Now()
job.Status.State.Phase = batch.Pending
job.Status.State.LastTransitionTime = metav1.Now()
job.Status.MinAvailable = job.Spec.MinAvailable
newJob, err := cc.vcClient.BatchV1alpha1().Jobs(job.Namespace).UpdateStatus(job)
if err != nil {
Expand Down

0 comments on commit 948e709

Please sign in to comment.