karmada-io / karmada

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

Remove the unused labels and annotations in the Work manifests. #4826

Open XiShanYongYe-Chang opened 2 weeks ago

XiShanYongYe-Chang commented 2 weeks ago

What would you like to be added:

Remove the unused labels and annotations in the Work manifests.

Why is this needed:

There are some labels and annotations related to PropagationPolicy and ResourceBinding on the resource template in the work. Those information is not used for the resources propagated to the member clusters. Do we need to retain them?

apiVersion: work.karmada.io/v1alpha1
kind: Work
metadata:
  name: cz-secret-5c4d6b86fd
  namespace: karmada-es-member1
spec:
  workload:
    manifests:
    - apiVersion: v1
      data: null
      kind: Secret
      metadata:
        annotations:
          propagationpolicy.karmada.io/name: sa-propagation
          propagationpolicy.karmada.io/namespace: default
          resourcebinding.karmada.io/name: cz-secret-secret
          resourcebinding.karmada.io/namespace: default
        labels:
          propagationpolicy.karmada.io/name: sa-propagation
          propagationpolicy.karmada.io/namespace: default
          propagationpolicy.karmada.io/permanent-id: d51cdbea-5c57-43e0-95d4-4c44b12d2012
          resourcebinding.karmada.io/permanent-id: a29745c8-86c2-4bc6-b182-425bdd068b81
        name: cz-secret
        namespace: default
      type: kubernetes.io/service-account-token

When the number of jobs is large, this information is redundant. Removing them can save some storage space.

XiShanYongYe-Chang commented 2 weeks ago

/cc @RainbowMango @chaunceyjiang @whitewindmills @a7i