Skip to content

Commit fbf3486

Browse files
authored
copy metadata fields on UpsertStatusImmutable (#472)
* copy metadata fields on UpsertStatusImmutable * move changelog to latest
1 parent 643019a commit fbf3486

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
- type: NON_USER_FACING
3+
description: >
4+
"Copy metadata from the existing object to the upserted object when upserting a status."

pkg/controllerutils/upsert.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ func UpdateStatusImmutable(
142142

143143
// https://github.com/solo-io/skv2/issues/344
144144
copyOfObj.SetUID(existing.GetUID())
145+
copyOfObj.SetCreationTimestamp(existing.GetCreationTimestamp())
146+
copyOfObj.SetResourceVersion(existing.GetResourceVersion())
145147

146148
return update(ctx, c, copyOfObj)
147149
}

0 commit comments

Comments
 (0)