karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

feat: support update event in WorkloadRebalancer #4860

Open chaosi-zju opened 1 week ago

chaosi-zju commented 1 week ago

DO NOT MERGE until the following PR have been merged:

What type of PR is this?

/kind feature

What this PR does / why we need it:

feat: support update event in WorkloadRebalancer

When spec filed of WorkloadRebalancer updated, we shall refresh the workload list in status.observedWorkloads:

  1. a new workload added to spec list, just add it into status list too and do the rebalance.
  2. a workload deleted from previous spec list, keep it in status list if already success, and remove it if not.
  3. a workload is modified, just regard it as deleted an old one and inserted a new one.
  4. just list order is disrupted, no additional action.

Which issue(s) this PR fixes:

Fixes part of #4840

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat: support update event in WorkloadRebalancer
karmada-bot commented 1 week ago

[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: - **[pkg/controllers/OWNERS](https://github.com/karmada-io/karmada/blob/master/pkg/controllers/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment