karmada-io / karmada

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

fix wrong annotation marks on resource #4751

Closed XiShanYongYe-Chang closed 1 month ago

XiShanYongYe-Chang commented 1 month ago

What type of PR is this?

/kind bug

What this PR does / why we need it:

Using the MergeAnnotation function will filter out existing keys. When the key value that needs to be marked changes, such as policy preemption, resource recovery, we need to use the ReplaceAnnotation function to replace the value of the key in the annotation.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed incorrect annotation markup when policy preemption occurs.
XiShanYongYe-Chang commented 1 month ago

/cc @whitewindmills @chaosi-zju @RainbowMango

karmada-bot commented 1 month ago

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