Skip to content

Commit

Permalink
Merge pull request karmada-io#4771 from XiShanYongYe-Chang/automated-…
Browse files Browse the repository at this point in the history
…cherry-pick-of-#4751-upstream-release-1.8

Automated cherry pick of karmada-io#4751: fix wrong annotation marks on resource
  • Loading branch information
karmada-bot authored Mar 28, 2024
2 parents eec084e + d585366 commit 35e288d
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 @@ -751,7 +751,7 @@ func (d *ResourceDetector) ClaimClusterPolicyForObject(object *unstructured.Unst
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyLabel, policy.Name)
util.MergeLabel(objectCopy, policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel, policyID)

util.MergeAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policy.Name)
util.ReplaceAnnotation(objectCopy, policyv1alpha1.ClusterPropagationPolicyAnnotation, policy.Name)
return policyID, 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 @@ -45,7 +45,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)
workloadJSON, err := workload.MarshalJSON()
if err != nil {
Expand Down

0 comments on commit 35e288d

Please sign in to comment.