diff --git a/pkg/dataprotection/backup/scheduler.go b/pkg/dataprotection/backup/scheduler.go index a199a9bb5bb..7107db273a9 100644 --- a/pkg/dataprotection/backup/scheduler.go +++ b/pkg/dataprotection/backup/scheduler.go @@ -516,9 +516,7 @@ func (s *Scheduler) reconfigure(schedulePolicy *dpv1alpha1.SchedulePolicy) error lastAppliedConfigsMap[schedulePolicy.BackupMethod] = updateParameterPairs updateParameterPairsBytes, _ = json.Marshal(lastAppliedConfigsMap) s.BackupSchedule.Annotations[dptypes.LastAppliedConfigsAnnotationKey] = string(updateParameterPairsBytes) - if _, ok := s.BackupSchedule.Annotations[constant.LastAppliedConfigAnnotationKey]; ok { - delete(s.BackupSchedule.Annotations, constant.LastAppliedConfigAnnotationKey) - } + delete(s.BackupSchedule.Annotations, constant.LastAppliedConfigAnnotationKey) if err := s.Client.Patch(s.Ctx, s.BackupSchedule, patch); err != nil { return err }