Skip to content

Commit

Permalink
Use merge strategy to avoid work.karmada.io/permanent-id changes.
Browse files Browse the repository at this point in the history
Signed-off-by: whitewindmills <[email protected]>
  • Loading branch information
whitewindmills authored and XiShanYongYe-Chang committed Apr 9, 2024
1 parent 0556e0d commit f573777
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 f573777

Please sign in to comment.