remove pp/cpp namespace/name labels

Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
changzhen 2024-06-03 09:58:19 +08:00
parent 37dd12f459
commit 64a5d0fa7a
4 changed files with 0 additions and 36 deletions

View File

@ -54,18 +54,3 @@ const (
// ClusterPropagationPolicyAnnotation is added to objects to specify associated ClusterPropagationPolicy name.
ClusterPropagationPolicyAnnotation = "clusterpropagationpolicy.karmada.io/name"
)
// TODO(whitewindmills): These deprecated labels will be removed in a future version.
const (
// PropagationPolicyNamespaceLabel is added to objects to specify associated PropagationPolicy namespace.
// Deprecated
PropagationPolicyNamespaceLabel = "propagationpolicy.karmada.io/namespace"
// PropagationPolicyNameLabel is added to objects to specify associated PropagationPolicy's name.
// Deprecated
PropagationPolicyNameLabel = "propagationpolicy.karmada.io/name"
// ClusterPropagationPolicyLabel is added to objects to specify associated ClusterPropagationPolicy.
// Deprecated
ClusterPropagationPolicyLabel = "clusterpropagationpolicy.karmada.io/name"
)

View File

@ -489,11 +489,7 @@ func (c *MCSController) claimMultiClusterServiceForService(svc *corev1.Service,
svcCopy.Annotations = map[string]string{}
}
// cleanup the policy labels
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyNameLabel)
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyNamespaceLabel)
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyPermanentIDLabel)
delete(svcCopy.Labels, policyv1alpha1.ClusterPropagationPolicyLabel)
delete(svcCopy.Labels, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel)
svcCopy.Labels[util.ResourceTemplateClaimedByLabel] = util.MultiClusterServiceKind

View File

@ -65,9 +65,6 @@ import (
var (
propagationPolicyMarkedLabels = []string{
policyv1alpha1.PropagationPolicyPermanentIDLabel,
// TODO(whitewindmills): Delete the following two lines in a future version.
policyv1alpha1.PropagationPolicyNamespaceLabel,
policyv1alpha1.PropagationPolicyNameLabel,
}
propagationPolicyMarkedAnnotations = []string{
policyv1alpha1.PropagationPolicyNamespaceAnnotation,
@ -75,8 +72,6 @@ var (
}
clusterPropagationPolicyMarkedLabels = []string{
policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel,
// TODO(whitewindmills): Delete the following line in a future version.
policyv1alpha1.ClusterPropagationPolicyLabel,
}
clusterPropagationPolicyMarkedAnnotations = []string{
policyv1alpha1.ClusterPropagationPolicyAnnotation,
@ -470,9 +465,6 @@ func (d *ResourceDetector) ApplyPolicy(object *unstructured.Unstructured, object
}
policyLabels := map[string]string{
// TODO(whitewindmills): Delete the following two lines in a future version.
policyv1alpha1.PropagationPolicyNamespaceLabel: policy.GetNamespace(),
policyv1alpha1.PropagationPolicyNameLabel: policy.GetName(),
policyv1alpha1.PropagationPolicyPermanentIDLabel: policyID,
}
policyAnnotations := map[string]string{
@ -564,8 +556,6 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured,
}
policyLabels := map[string]string{
// TODO(whitewindmills): Delete the following line in a future version.
policyv1alpha1.ClusterPropagationPolicyLabel: policy.GetName(),
policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel: policyID,
}
policyAnnotations := map[string]string{
@ -722,9 +712,6 @@ func (d *ResourceDetector) ClaimPolicyForObject(object *unstructured.Unstructure
}
}
// TODO(whitewindmills): Delete the following two lines in a future version.
objLabels[policyv1alpha1.PropagationPolicyNamespaceLabel] = policy.Namespace
objLabels[policyv1alpha1.PropagationPolicyNameLabel] = policy.Name
objLabels[policyv1alpha1.PropagationPolicyPermanentIDLabel] = policyID
objectAnnotations := object.GetAnnotations()
@ -751,8 +738,6 @@ func (d *ResourceDetector) ClaimClusterPolicyForObject(object *unstructured.Unst
}
objectCopy := object.DeepCopy()
// TODO(whitewindmills): Delete the following line in a future version.
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyLabel, policy.Name)
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel, policyID)
util.MergeAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policy.Name)

View File

@ -345,7 +345,5 @@ func excludeClusterPolicy(objLabels map[string]string) bool {
return false
}
delete(objLabels, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel)
// TODO(whitewindmills): Delete the following line in a future version.
delete(objLabels, policyv1alpha1.ClusterPropagationPolicyLabel)
return true
}