karmada-io / karmada

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

Use merge strategy to avoid work.karmada.io/permanent-id changes #4793

Closed whitewindmills closed 1 month ago

whitewindmills commented 1 month ago

What type of PR is this? /kind bug

What this PR does / why we need it: Since labels will be overwritten every time they are updated and created, this causes work.karmada.io/permanent-id to constantly change. I add some debug logs in karmada-webhook to capture the bug: image

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

karmada-controller-manager: Fix the problem that work.karmada.io/permanent-id constantly changes with every update.
codecov-commenter commented 1 month ago

Codecov Report

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

Project coverage is 51.76%. Comparing base (a0c0a98) to head (9c08138).

Files Patch % Lines
pkg/util/helper/work.go 0.00% 2 Missing :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4793 +/- ## ========================================== + Coverage 51.75% 51.76% +0.01% ========================================== Files 250 250 Lines 24980 24980 ========================================== + Hits 12928 12931 +3 + Misses 11342 11339 -3 Partials 710 710 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/4793/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/4793/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `51.76% <0.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io#carryforward-flags-in-the-pull-request-comment) to find out more.

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

whitewindmills commented 1 month ago

/cc @XiShanYongYe-Chang @chaunceyjiang

whitewindmills commented 1 month ago

Did you discover the problem during development?

Yes, this causes CI to always fail.

whitewindmills commented 1 month ago

Another PR https://github.com/karmada-io/karmada/pull/4743 still needs this, could you take look? /cc @RainbowMango

XiShanYongYe-Chang commented 1 month ago

Hi @whitewindmills, how about adding the release note, I think we should cherry-pick this patch to the previous branch, how do you think?

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