karmada-io / karmada

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

Unable to sync labels correctly #4781

Closed whitewindmills closed 1 month ago

whitewindmills commented 1 month ago

What happened: I created a resource template to propagate to member clusters, but cannot delete any label which already exists via Karmada.

ConfigMap of Karmada control-plane

image

ConfigMap of Member clusters

image

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

  1. Create any resource to propagate to member clusters.
  2. Add any label to your resource via Karmada.
  3. Delete the label via Karmada.

Anything else we need to know?: I found the propagated resource is missing the annotation resourcetemplate.karmada.io/managed-labels, and the annotation was mistakenly added to the work object. image

Environment:

whitewindmills commented 1 month ago

I've figured out the source of this problem, it was introduced by https://github.com/karmada-io/karmada/pull/4199. image

/assign cc @XiShanYongYe-Chang @RainbowMango