From 61bb2ec06132c56be0cf0a1a160d905e5f58c960 Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Thu, 9 Jan 2025 18:13:28 +0000 Subject: [PATCH] copy the status field --- lib/auth/usertasks/usertasksv1/service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/auth/usertasks/usertasksv1/service.go b/lib/auth/usertasks/usertasksv1/service.go index 1853a04964b3e..dcea679c76e2a 100644 --- a/lib/auth/usertasks/usertasksv1/service.go +++ b/lib/auth/usertasks/usertasksv1/service.go @@ -19,6 +19,7 @@ package usertasksv1 import ( + "cmp" "context" "log/slog" "time" @@ -353,7 +354,7 @@ func (s *Service) updateStatus(ut *usertasksv1.UserTask, existing *usertasksv1.U if existing != nil { // Inherit everything from existing UserTask. - ut.Status = existing.Status + ut.Status.LastStateChange = cmp.Or(existing.Status.LastStateChange, ut.Status.LastStateChange) // Update specific values. if existing.GetSpec().GetState() != ut.GetSpec().GetState() {