Skip to content

Commit

Permalink
Merge pull request #4770 from XiShanYongYe-Chang/automated-cherry-pic…
Browse files Browse the repository at this point in the history
…k-of-#4751-upstream-release-1.7

Automated cherry pick of #4751: fix wrong annotation marks on resource
  • Loading branch information
karmada-bot authored Mar 28, 2024
2 parents 7d8674b + 795ef15 commit 5ce59e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/detector/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ func (d *ResourceDetector) ClaimClusterPolicyForObject(object *unstructured.Unst
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyLabel, policyName)
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyUIDLabel, policyUID)

util.MergeAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policyName)
util.ReplaceAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policyName)
return d.Client.Update(context.TODO(), objectCopy)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/helper/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func CreateOrUpdateWork(client client.Client, workMeta metav1.ObjectMeta, resour
if conflictResolution, ok := workMeta.GetAnnotations()[workv1alpha2.ResourceConflictResolutionAnnotation]; ok {
util.ReplaceAnnotation(workload, workv1alpha2.ResourceConflictResolutionAnnotation, conflictResolution)
}
util.MergeAnnotation(workload, workv1alpha2.ResourceTemplateUIDAnnotation, string(workload.GetUID()))
util.ReplaceAnnotation(workload, workv1alpha2.ResourceTemplateUIDAnnotation, string(workload.GetUID()))
util.RecordManagedAnnotations(workload)
util.RecordManagedLabels(workload)
workloadJSON, err := workload.MarshalJSON()
Expand Down

0 comments on commit 5ce59e7

Please sign in to comment.