From 89268758a7b8db03483945841cd62ddd4bbb62b7 Mon Sep 17 00:00:00 2001 From: limk <1144650984@qq.com> Date: Fri, 20 Dec 2019 16:00:46 +0800 Subject: [PATCH] remove redundant type conversion job.Status.State int32 job.Spec.MinAvailable int32 --- pkg/controllers/job/job_controller_actions.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/job/job_controller_actions.go b/pkg/controllers/job/job_controller_actions.go index cf95229018..30367df408 100644 --- a/pkg/controllers/job/job_controller_actions.go +++ b/pkg/controllers/job/job_controller_actions.go @@ -101,7 +101,7 @@ func (cc *Controller) killJob(jobInfo *apis.JobInfo, podRetainPhase state.PhaseM Terminating: terminating, Unknown: unknown, Version: job.Status.Version, - MinAvailable: int32(job.Spec.MinAvailable), + MinAvailable: job.Spec.MinAvailable, RetryCount: job.Status.RetryCount, } @@ -308,7 +308,7 @@ func (cc *Controller) syncJob(jobInfo *apis.JobInfo, updateStatus state.UpdateSt Terminating: terminating, Unknown: unknown, Version: job.Status.Version, - MinAvailable: int32(job.Spec.MinAvailable), + MinAvailable: job.Spec.MinAvailable, ControlledResources: job.Status.ControlledResources, RetryCount: job.Status.RetryCount, } @@ -509,7 +509,7 @@ func (cc *Controller) initJobStatus(job *batch.Job) (*batch.Job, error) { } job.Status.State.Phase = batch.Pending - job.Status.MinAvailable = int32(job.Spec.MinAvailable) + job.Status.MinAvailable = job.Spec.MinAvailable newJob, err := cc.vcClient.BatchV1alpha1().Jobs(job.Namespace).UpdateStatus(job) if err != nil { klog.Errorf("Failed to update status of Job %v/%v: %v",