From 291697fc90545b989f776c43bb977371fca0ccf1 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 6 Feb 2025 13:28:52 +0800 Subject: [PATCH] fix: enable pitr failed for postgresql (#8879) (cherry picked from commit 4576bb478345339b743d8b815a15c2e7cee0af57) --- pkg/dataprotection/backup/scheduler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/dataprotection/backup/scheduler.go b/pkg/dataprotection/backup/scheduler.go index c9f426178d1..800fc60ad87 100644 --- a/pkg/dataprotection/backup/scheduler.go +++ b/pkg/dataprotection/backup/scheduler.go @@ -380,8 +380,12 @@ func (s *Scheduler) convertLastAppliedConfigs(continuousMethod string) { } func (s *Scheduler) getLastAppliedConfigsMap() (map[string]string, error) { + lastAppliedConfigAnno := s.BackupSchedule.Annotations[dptypes.LastAppliedConfigsAnnotationKey] + if lastAppliedConfigAnno == "" { + return map[string]string{}, nil + } resMap := map[string]string{} - if err := json.Unmarshal([]byte(s.BackupSchedule.Annotations[dptypes.LastAppliedConfigsAnnotationKey]), &resMap); err != nil { + if err := json.Unmarshal([]byte(lastAppliedConfigAnno), &resMap); err != nil { return nil, err } return resMap, nil