-
Notifications
You must be signed in to change notification settings - Fork 917
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: work status sync when work dispatching is suspended #5403
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5403 +/- ##
==========================================
+ Coverage 29.67% 29.80% +0.12%
==========================================
Files 632 632
Lines 43936 43942 +6
==========================================
+ Hits 13037 13095 +58
+ Misses 29954 29887 -67
- Partials 945 960 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks @a7i |
/assign |
@@ -222,6 +222,11 @@ func (c *WorkStatusController) syncWorkStatus(key util.QueueKey) error { | |||
return nil | |||
} | |||
|
|||
// Work in a suspend state means it never dispatches updates to the member cluster. | |||
if helper.IsWorkSuspendDispatching(workObject) { |
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.
Hi @a7i If we add this judgment to this position, we also discard the state collection.
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.
good catch, updated.
8da0901
to
7f01b17
Compare
Signed-off-by: Amir Alavi <[email protected]>
7f01b17
to
5f54261
Compare
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 a lot~
/lgtm
/assign @RainbowMango
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.
/approve
return c.reflectStatus(ctx, workObject, observedObj) | ||
} | ||
|
||
func (c *WorkStatusController) updateResource(ctx context.Context, observedObj *unstructured.Unstructured, workObject *workv1alpha1.Work, fedKey keys.FederatedKey) error { |
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.
It looks great to have this method dedicated to updating. Thanks.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
As discussed in #5397 , we should not sync work status, because it attempts to update the resource in the member cluster
Which issue(s) this PR fixes:
Fixes #5397
Special notes for your reviewer:
Does this PR introduce a user-facing change?: