-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
controller: Update status in time #476
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Signed-off-by: Ce Gao <gaoce@caicloud.io>
pkg/controller/controller_pod.go
Outdated
tfjob.Status.TFReplicaStatuses[rtype].Succeeded = succeeded | ||
tfjob.Status.TFReplicaStatuses[rtype].Failed = failed | ||
|
||
log.Info(tfjob.Status.TFReplicaStatuses[rtype]) |
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.
Remove this log?
pkg/controller/controller_pod.go
Outdated
@@ -129,12 +129,13 @@ func (tc *TFJobController) reconcilePods( | |||
tfjob.Status.TFReplicaStatuses[rtype] = &tfv1alpha2.TFReplicaStatus{} | |||
} | |||
|
|||
tfjob.Status.TFReplicaStatuses[rtype].Active = int32(len(activePods)) | |||
tfjob.Status.TFReplicaStatuses[rtype].Active -= int32(diff) |
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.
Can you add some comments about this logic?
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.
OK, will do it.
Signed-off-by: Ce Gao <gaoce@caicloud.io>
PTAL @ScorpioCPH |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ScorpioCPH 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 |
/assign @ScorpioCPH
Now we do not update the status because we return error before the update function call. Then I changed the behaviour.
This change is