Skip to content

Commit

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

Automated cherry pick of #4793: Use merge strategy to avoid work.karmada.io/permanent-id
  • Loading branch information
karmada-bot committed Apr 10, 2024
2 parents 0556e0d + f573777 commit 532a290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/helper/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func CreateOrUpdateWork(client client.Client, workMeta metav1.ObjectMeta, resour
// TODO: Delete following one line in release-1.9
delete(runtimeObject.Labels, workv1alpha2.WorkUIDLabel)
runtimeObject.Spec = work.Spec
runtimeObject.Labels = work.Labels
runtimeObject.Annotations = work.Annotations
runtimeObject.Labels = util.DedupeAndMergeLabels(runtimeObject.Labels, work.Labels)
runtimeObject.Annotations = util.DedupeAndMergeAnnotations(runtimeObject.Annotations, work.Annotations)
if util.GetLabelValue(runtimeObject.Labels, workv1alpha2.WorkPermanentIDLabel) == "" {
runtimeObject.Labels = util.DedupeAndMergeLabels(runtimeObject.Labels, map[string]string{workv1alpha2.WorkPermanentIDLabel: uuid.New().String()})
}
Expand Down

0 comments on commit 532a290

Please sign in to comment.