Skip to content

Commit

Permalink
Merge pull request #4751 from XiShanYongYe-Chang/fix-worng-annotation…
Browse files Browse the repository at this point in the history
…-marks

fix wrong annotation marks on resource
  • Loading branch information
karmada-bot authored Mar 27, 2024
2 parents c5c6ffa + b808f37 commit b0889c5
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 @@ -780,7 +780,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 b0889c5

Please sign in to comment.