From d0dadb282a9ecb0b1e6ab4443f540fbc5c0aa962 Mon Sep 17 00:00:00 2001 From: changzhen Date: Sat, 7 May 2022 11:02:22 +0800 Subject: [PATCH] skip reflect work status when resource has empty status Signed-off-by: changzhen --- pkg/controllers/status/workstatus_controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controllers/status/workstatus_controller.go b/pkg/controllers/status/workstatus_controller.go index de86b8a46..7dc20a75e 100644 --- a/pkg/controllers/status/workstatus_controller.go +++ b/pkg/controllers/status/workstatus_controller.go @@ -283,6 +283,10 @@ func (c *WorkStatusController) reflectStatus(work *workv1alpha1.Work, clusterObj clusterObj.GetKind(), clusterObj.GetNamespace(), clusterObj.GetName(), err) } + if statusRaw == nil { + return nil + } + identifier, err := c.buildStatusIdentifier(work, clusterObj) if err != nil { return err