Skip to content

Commit 049ddc6

Browse files
authored
Merge pull request #5020 from XiShanYongYe-Chang/remove=pp-namespce-name-labels
Remove pp/cpp namespace/name labels
2 parents b8bf8fc + 64a5d0f commit 049ddc6

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

pkg/apis/policy/v1alpha1/well_known_constants.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,3 @@ const (
5454
// ClusterPropagationPolicyAnnotation is added to objects to specify associated ClusterPropagationPolicy name.
5555
ClusterPropagationPolicyAnnotation = "clusterpropagationpolicy.karmada.io/name"
5656
)
57-
58-
// TODO(whitewindmills): These deprecated labels will be removed in a future version.
59-
const (
60-
// PropagationPolicyNamespaceLabel is added to objects to specify associated PropagationPolicy namespace.
61-
// Deprecated
62-
PropagationPolicyNamespaceLabel = "propagationpolicy.karmada.io/namespace"
63-
64-
// PropagationPolicyNameLabel is added to objects to specify associated PropagationPolicy's name.
65-
// Deprecated
66-
PropagationPolicyNameLabel = "propagationpolicy.karmada.io/name"
67-
68-
// ClusterPropagationPolicyLabel is added to objects to specify associated ClusterPropagationPolicy.
69-
// Deprecated
70-
ClusterPropagationPolicyLabel = "clusterpropagationpolicy.karmada.io/name"
71-
)

pkg/controllers/multiclusterservice/mcs_controller.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,7 @@ func (c *MCSController) claimMultiClusterServiceForService(svc *corev1.Service,
489489
svcCopy.Annotations = map[string]string{}
490490
}
491491

492-
// cleanup the policy labels
493-
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyNameLabel)
494-
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyNamespaceLabel)
495492
delete(svcCopy.Labels, policyv1alpha1.PropagationPolicyPermanentIDLabel)
496-
delete(svcCopy.Labels, policyv1alpha1.ClusterPropagationPolicyLabel)
497493
delete(svcCopy.Labels, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel)
498494

499495
svcCopy.Labels[util.ResourceTemplateClaimedByLabel] = util.MultiClusterServiceKind

pkg/detector/detector.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,13 @@ import (
6565
var (
6666
propagationPolicyMarkedLabels = []string{
6767
policyv1alpha1.PropagationPolicyPermanentIDLabel,
68-
// TODO(whitewindmills): Delete the following two lines in a future version.
69-
policyv1alpha1.PropagationPolicyNamespaceLabel,
70-
policyv1alpha1.PropagationPolicyNameLabel,
7168
}
7269
propagationPolicyMarkedAnnotations = []string{
7370
policyv1alpha1.PropagationPolicyNamespaceAnnotation,
7471
policyv1alpha1.PropagationPolicyNameAnnotation,
7572
}
7673
clusterPropagationPolicyMarkedLabels = []string{
7774
policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel,
78-
// TODO(whitewindmills): Delete the following line in a future version.
79-
policyv1alpha1.ClusterPropagationPolicyLabel,
8075
}
8176
clusterPropagationPolicyMarkedAnnotations = []string{
8277
policyv1alpha1.ClusterPropagationPolicyAnnotation,
@@ -470,9 +465,6 @@ func (d *ResourceDetector) ApplyPolicy(object *unstructured.Unstructured, object
470465
}
471466

472467
policyLabels := map[string]string{
473-
// TODO(whitewindmills): Delete the following two lines in a future version.
474-
policyv1alpha1.PropagationPolicyNamespaceLabel: policy.GetNamespace(),
475-
policyv1alpha1.PropagationPolicyNameLabel: policy.GetName(),
476468
policyv1alpha1.PropagationPolicyPermanentIDLabel: policyID,
477469
}
478470
policyAnnotations := map[string]string{
@@ -564,8 +556,6 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured,
564556
}
565557

566558
policyLabels := map[string]string{
567-
// TODO(whitewindmills): Delete the following line in a future version.
568-
policyv1alpha1.ClusterPropagationPolicyLabel: policy.GetName(),
569559
policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel: policyID,
570560
}
571561
policyAnnotations := map[string]string{
@@ -722,9 +712,6 @@ func (d *ResourceDetector) ClaimPolicyForObject(object *unstructured.Unstructure
722712
}
723713
}
724714

725-
// TODO(whitewindmills): Delete the following two lines in a future version.
726-
objLabels[policyv1alpha1.PropagationPolicyNamespaceLabel] = policy.Namespace
727-
objLabels[policyv1alpha1.PropagationPolicyNameLabel] = policy.Name
728715
objLabels[policyv1alpha1.PropagationPolicyPermanentIDLabel] = policyID
729716

730717
objectAnnotations := object.GetAnnotations()
@@ -751,8 +738,6 @@ func (d *ResourceDetector) ClaimClusterPolicyForObject(object *unstructured.Unst
751738
}
752739

753740
objectCopy := object.DeepCopy()
754-
// TODO(whitewindmills): Delete the following line in a future version.
755-
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyLabel, policy.Name)
756741
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel, policyID)
757742

758743
util.MergeAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policy.Name)

pkg/detector/policy.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,5 @@ func excludeClusterPolicy(objLabels map[string]string) bool {
345345
return false
346346
}
347347
delete(objLabels, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel)
348-
// TODO(whitewindmills): Delete the following line in a future version.
349-
delete(objLabels, policyv1alpha1.ClusterPropagationPolicyLabel)
350348
return true
351349
}

0 commit comments

Comments
 (0)