Skip to content

Commit

Permalink
fix: pg cluster enable backupschedule wal-g-archive config archive_co…
Browse files Browse the repository at this point in the history
…mmand twice (#8935)
  • Loading branch information
wangyelei authored Feb 17, 2025
1 parent 1400725 commit 8297e32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/dataprotection/backup/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,12 @@ func (s *Scheduler) reconfigure(schedulePolicy *dpv1alpha1.SchedulePolicy) error
return err
}

lastAppliedConfigsMap, err := s.getLastAppliedConfigsMap()
if err != nil {
return err
}
enable := boolptr.IsSetToTrue(schedulePolicy.Enabled)
if s.BackupSchedule.Annotations[dptypes.LastAppliedConfigsAnnotationKey] == "" && !enable {
if _, ok := lastAppliedConfigsMap[schedulePolicy.BackupMethod]; !ok && !enable {
// disable in the first policy created, no need reconfigure because default configs had been set.
return nil
}
Expand All @@ -420,10 +424,6 @@ func (s *Scheduler) reconfigure(schedulePolicy *dpv1alpha1.SchedulePolicy) error
// skip reconfigure if not found parameters.
return nil
}
lastAppliedConfigsMap, err := s.getLastAppliedConfigsMap()
if err != nil {
return err
}
updateParameterPairsBytes, _ := json.Marshal(parameters)
updateParameterPairs := string(updateParameterPairsBytes)
if updateParameterPairs == lastAppliedConfigsMap[schedulePolicy.BackupMethod] {
Expand Down

0 comments on commit 8297e32

Please sign in to comment.