Merge pull request #4793 from whitewindmills/fix-work-permanentID
Use merge strategy to avoid work.karmada.io/permanent-id changes
This commit is contained in:
commit
4f99ebd447
|
@ -78,8 +78,8 @@ func CreateOrUpdateWork(client client.Client, workMeta metav1.ObjectMeta, resour
|
|||
}
|
||||
|
||||
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()})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue