Skip to content
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

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Aug 19, 2024

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?:


@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 19, 2024
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 19, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 29.80%. Comparing base (6318541) to head (5f54261).
Report is 9 commits behind head on master.

Files Patch % Lines
pkg/controllers/status/work_status_controller.go 44.44% 4 Missing and 1 partial ⚠️

❗ 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     
Flag Coverage Δ
unittests 29.80% <44.44%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XiShanYongYe-Chang
Copy link
Member

Thanks @a7i
/kind feature
/retest

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 20, 2024
@XiShanYongYe-Chang
Copy link
Member

/assign

@a7i
Copy link
Contributor Author

a7i commented Aug 20, 2024

/retest

it failed on uploading logs
Screenshot 2024-08-19 at 10 31 37 PM

@@ -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) {
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, updated.

@a7i a7i force-pushed the work-status-suspend branch from 8da0901 to 7f01b17 Compare August 20, 2024 14:40
@a7i a7i force-pushed the work-status-suspend branch from 7f01b17 to 5f54261 Compare August 20, 2024 14:45
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a 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

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2024
Copy link
Member

@RainbowMango RainbowMango left a 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 {
Copy link
Member

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.

@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2024
@karmada-bot karmada-bot merged commit 4eea6da into karmada-io:master Aug 26, 2024
12 checks passed
@RainbowMango RainbowMango added this to the v1.11 milestone Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suspension dispatching vs scale subresource
5 participants