don't collect status data when the work to be deleted

Signed-off-by: yy158775 <1584616775@qq.com>
This commit is contained in:
yy158775 2022-07-30 15:42:16 +08:00
parent ec84d649a9
commit e26c0880cd
1 changed files with 5 additions and 0 deletions

View File

@ -194,6 +194,11 @@ func (c *WorkStatusController) syncWorkStatus(key util.QueueKey) error {
return err
}
// stop update status if Work object in terminating state.
if !workObject.DeletionTimestamp.IsZero() {
return nil
}
desiredObj, err := c.getRawManifest(workObject.Spec.Workload.Manifests, observedObj)
if err != nil {
return err