-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: use index number in clusterStagedUpdateRun and add ApprovalAccepted status to ApprovalRequests #1019
base: main
Are you sure you want to change the base?
Conversation
2843cee
to
79a44b9
Compare
c9bf1a9
to
dd0aad0
Compare
dd0aad0
to
fe9aefe
Compare
GenericFunc: func(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) { | ||
klog.V(2).InfoS("Handling a clusterApprovalRequest generic event", "clusterApprovalRequest", klog.KObj(e.Object)) | ||
handleClusterApprovalRequest(e.Object, q) | ||
handleClusterApprovalRequest(e.ObjectOld, e.ObjectNew, q) |
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.
just curious, I wonder why removing the genricFunc? I put it there just for safety as I am not 100% sure what is considered "generic".
// and enqueues it to the ClusterStagedUpdateRun controller queue. | ||
func handleClusterApprovalRequest(obj client.Object, q workqueue.RateLimitingInterface) { | ||
approvalRequest, ok := obj.(*placementv1beta1.ClusterApprovalRequest) | ||
// and enqueues it to the ClusterStagedUpdateRun controller queue only when the approved condition gets changed. |
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.
// and enqueues it to the ClusterStagedUpdateRun controller queue only when the approved condition gets changed. | |
// and enqueues it to the ClusterStagedUpdateRun controller queue only when the approved condition is changed. |
klog.ErrorS(mismatchErr, "there's a new latest policy snapshot", "clusterResourcePlacement", placementName, "clusterStagedUpdateRun", updateRunRef) | ||
return -1, nil, nil, fmt.Errorf("%w: %s", errStagedUpdatedAborted, mismatchErr.Error()) | ||
} | ||
// Make sure the cluster count in the policy snapshot has not changed. | ||
if updateRun.Status.PolicyObservedClusterCount != clusterCount { | ||
// PickAll policy case will be verified in validateStagesStatus. | ||
if clusterCount != -1 && updateRun.Status.PolicyObservedClusterCount != clusterCount { |
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 adding the extra check since both will be -1 in the case of pickAll
Description of your changes
ApprovalAccepted
status in approvalRequestsFixes #
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer