-
Notifications
You must be signed in to change notification settings - Fork 73
refine arguments of ControllerInterface.UpdateJobStatus #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot you obtain this information by iterating through the replicas map?
for rtype, spec := range replicas {
err = jc.ReconcilePods(metaObject, &jobStatus, pods, rtype, spec, replicasStatus, replicas) Because |
Sure but I mean in your actual implementation of |
Yes, but I think, we need to know specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. That makes sense. cc'ing others here to double check as well.
/lgtm
/cc @gaocegege @johnugeorge @jian-he @richardsliu
I think the implementation can still be that , loop over the "rtype, replicas" and based on each type, set the job status accordingly. Also, could this updateJobStatus call be moved out from this reconcilePods method and placed after the for loop, here. This way, it can also be merged with the UpdateJobStatusInApiServer interface. |
I agreed with you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution
Generally, LGTM
Please fix the test failures |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/cc @johnugeorge @richardsliu
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions on your new changes.
@@ -301,7 +301,6 @@ func (jc *JobController) ReconcilePods( | |||
return err | |||
} | |||
numReplicas := int(*spec.Replicas) | |||
restart := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because restart or not can be inferred from replicas
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay sounds good. Thanks.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: terrytangyuan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: Paul Angerer <dabauxi@users.noreply.github.com>
Move
UpdateJobStatus
out of ReconcilePods loop, and remove bool arg(restart
) which can be inferred fromreplicas
.This change is