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

feat: ability to suspend Work #4838

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Apr 17, 2024

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 #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.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 17, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

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

Project coverage is 52.86%. Comparing base (6cfed59) to head (d854b00).

Files Patch % Lines
pkg/detector/detector.go 0.00% 5 Missing ⚠️
pkg/controllers/binding/common.go 50.00% 2 Missing ⚠️
pkg/util/helper/work.go 0.00% 2 Missing ⚠️
...controllers/unifiedauth/unified_auth_controller.go 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4838      +/-   ##
==========================================
- Coverage   53.19%   52.86%   -0.33%     
==========================================
  Files         252      253       +1     
  Lines       20509    20665     +156     
==========================================
+ Hits        10909    10924      +15     
- Misses       8880     9018     +138     
- Partials      720      723       +3     
Flag Coverage Δ
unittests 52.86% <44.44%> (-0.33%) ⬇️

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.

@@ -173,6 +173,13 @@ type PropagationSpec struct {
// +kubebuilder:validation:Enum=Lazy
// +optional
ActivationPreference ActivationPreference `json:"activationPreference,omitempty"`

// Suspend tells the controller to suspend subsequent executions.
Copy link
Member

Choose a reason for hiding this comment

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

Whether the suspension operation is transparently transferred to the work object or the policy execution is suspended?

Copy link
Contributor Author

@a7i a7i Apr 17, 2024

Choose a reason for hiding this comment

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

The suspension operation is transparently transferred to the work object.

Is this better?

Suggested change
// Suspend tells the controller to suspend subsequent executions.
// Suspend will instruct all work objects to pause propagation to member clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to the suggestion above, let me know what you think

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if what really needs to be paused is the propagation of work. Pauses on pp and rb are to facilitate the transfer of user intent to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would you please elaborate?

This PR facilitates the transfer of suspend to work and it pauses propagation of work.

Copy link
Member

Choose a reason for hiding this comment

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

Please ignore my question above. I see that's how you've implemented it now.

//
// +kubebuilder:default=false
// +optional
Suspend bool `json:"suspend,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

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

@karmada-bot
Copy link
Collaborator

@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.

@a7i
Copy link
Contributor Author

a7i commented Apr 23, 2024

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

@XiShanYongYe-Chang
Copy link
Member

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.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign chaunceyjiang after the PR has been reviewed.
You can assign the PR to them by writing /assign @chaunceyjiang in a comment when ready.

The full list of commands accepted by this bot can be found 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

@a7i a7i force-pushed the work-suspend branch 2 times, most recently from 6f1798d to d854b00 Compare May 16, 2024 01:02
Signed-off-by: Amir Alavi <amir.alavi@zendesk.com>
@XiShanYongYe-Chang
Copy link
Member

Hi @a7i, we discussed how to design the API to provide users with the resources deletion policy in #4788 (comment). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to suspend work
4 participants