karmada icon indicating copy to clipboard operation
karmada copied to clipboard

feat: ability to suspend `Work`

Open a7i opened this issue 10 months ago • 8 comments

What type of PR is this?

/kind feature

What this PR does / why we need it: Ability to suspend work to ensure that changes are not being reconciled.

Which issue(s) this PR fixes: Fixes https://github.com/karmada-io/karmada/issues/4688

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Ability to suspend Work to ensure that changes are not being reconciled.

a7i avatar Apr 17 '24 01:04 a7i

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

Codecov Report

Attention: Patch coverage is 45.45455% with 18 lines in your changes missing coverage. Please review.

Project coverage is 28.28%. Comparing base (3a4861f) to head (58dbd6b). Report is 266 commits behind head on master.

Files with missing lines Patch % Lines
pkg/detector/detector.go 0.00% 5 Missing :warning:
pkg/controllers/binding/common.go 80.00% 3 Missing :warning:
.../controllers/multiclusterservice/mcs_controller.go 0.00% 2 Missing :warning:
pkg/util/helper/work.go 0.00% 2 Missing :warning:
...equota/federated_resource_quota_sync_controller.go 0.00% 1 Missing :warning:
pkg/controllers/mcs/service_export_controller.go 0.00% 1 Missing :warning:
...clusterservice/endpointslice_collect_controller.go 0.00% 1 Missing :warning:
...lusterservice/endpointslice_dispatch_controller.go 0.00% 1 Missing :warning:
...controllers/namespace/namespace_sync_controller.go 0.00% 1 Missing :warning:
...controllers/unifiedauth/unified_auth_controller.go 0.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4838      +/-   ##
==========================================
+ Coverage   28.24%   28.28%   +0.03%     
==========================================
  Files         632      632              
  Lines       43753    43777      +24     
==========================================
+ Hits        12360    12381      +21     
- Misses      30492    30493       +1     
- Partials      901      903       +2     
Flag Coverage Δ
unittests 28.28% <45.45%> (+0.03%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 17 '24 02:04 codecov-commenter

@XiShanYongYe-Chang: GitHub didn't allow me to request PR reviews from the following users: CharlesQQ.

Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Do we need to consider setting pause fields for different clusters so that different pause policies can be set for different work of the same resource?

/cc @CharlesQQ @RainbowMango

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

karmada-bot avatar Apr 19 '24 07:04 karmada-bot

@XiShanYongYe-Chang What's your feeling on this PR? Should I rebase and keep it up to date or do you not see this as a feature?

a7i avatar Apr 23 '24 00:04 a7i

I agree with this feature. I'm currently working on this area to see if karmada can provide users with faster capabilities based on this. I'll sync when I make progress. Thanks.

XiShanYongYe-Chang avatar Apr 23 '24 01:04 XiShanYongYe-Chang

Hi @a7i, we discussed how to design the API to provide users with the resources deletion policy in https://github.com/karmada-io/karmada/pull/4788#discussion_r1582008275. This is similar to Work suspension. They both describe the synchronization behavior of resource templates in member clusters, and can be resolved in three ways. Therefore, I'd like to know your opinions on how to design the API. Thanks a lot.

XiShanYongYe-Chang avatar May 17 '24 08:05 XiShanYongYe-Chang

@XiShanYongYe-Chang any updates? it sounds like annotations are preferred over fields on Spec (ref)?

a7i avatar May 29 '24 11:05 a7i

That's it for now, but there's no discussion about the suspension of the work propagation. I'll continue to analyze this feature starting with the next release (i.e. next month).

XiShanYongYe-Chang avatar May 30 '24 02:05 XiShanYongYe-Chang

Hi @a7i Just an update on this PR. This feature starts with a simple request that wants the Work can be paused, and then a few more use cases are added that this feature might be used in rollout scenarios, I think #5118 addresses all these scenarios. I will focus on the proposal first and then get back on this after we make the decision there.

I think this feature will be included in the coming v1.11 release(by the end of Aug), does that meet your schedule?

RainbowMango avatar Jul 12 '24 10:07 RainbowMango

That sounds good @RainbowMango

I would be interested in contributing to the feature, if it's easy to split up.

a7i avatar Jul 12 '24 12:07 a7i

@XiShanYongYe-Chang and @RainbowMango would appreciate some early feedback to make sure I'm on the right path. Currently working on remaining items:

  • add the condition to status in work status controller
  • add more e2e from the proposal
  • add webhook validation (happy to carve this out to a separate PR if you suggest)

anything else missing?

a7i avatar Jul 24 '24 22:07 a7i

Hi @a7i thanks for your hard work. I think we can take small steps and submit PRs for each of the items you listed.

Is the current completed content ready for review?

XiShanYongYe-Chang avatar Jul 25 '24 01:07 XiShanYongYe-Chang

Yes it is ready, excluding the items listed above

a7i avatar Jul 25 '24 20:07 a7i

/assign

whitewindmills avatar Jul 26 '24 02:07 whitewindmills

@XiShanYongYe-Chang: GitHub didn't allow me to request PR reviews from the following users: CharlesQQ.

Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Thanks~ /lgtm /cc @whitewindmills @CharlesQQ @RainbowMango

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

karmada-bot avatar Jul 30 '24 02:07 karmada-bot

Look forward to your feedback @whitewindmills @CharlesQQ @RainbowMango

a7i avatar Aug 01 '24 02:08 a7i

Created a PR for webhook validation that is rebased on top of this: https://github.com/karmada-io/karmada/pull/5282

Going to create another PR for work status condition and rebase on top of this

a7i avatar Aug 01 '24 02:08 a7i

I'll take a look ASAP.

whitewindmills avatar Aug 01 '24 03:08 whitewindmills

[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 avatar Aug 06 '24 01:08 karmada-bot