@@ -129,25 +129,31 @@ func Evaluate(cfg config.LifecycleConf, backups []backup.BackupMeta, dryRun bool
129129 continue
130130 }
131131
132+ // Weekly Retention Bucket
132133 if cfg .WeeklyRetention > 0 && ! bcpTime .Before (weeklyCutoff ) {
133134 if isCalendar {
134135 year , week := bcpTime .ISOWeek ()
135- weekKey := fmt .Sprintf ("calendar-week-%d-W%02d" , year , week )
136+ // Append the backup Type to the bucket key
137+ weekKey := fmt .Sprintf ("calendar-week-%d-W%02d-%s" , year , week , bcp .Type )
136138 weeklyCandidates [weekKey ] = append (weeklyCandidates [weekKey ], bcp )
137139 } else {
138140 weekBucket := ageInDays / 7
139- weekKey := fmt .Sprintf ("rolling-week-%d" , weekBucket )
141+ // Append the backup Type to the bucket key
142+ weekKey := fmt .Sprintf ("rolling-week-%d-%s" , weekBucket , bcp .Type )
140143 weeklyCandidates [weekKey ] = append (weeklyCandidates [weekKey ], bcp )
141144 }
142145 }
143146
147+ // Monthly Retention Bucket
144148 if cfg .MonthlyRetention > 0 && ! bcpTime .Before (monthlyCutoff ) {
145149 if isCalendar {
146- monthKey := bcpTime .Format ("2006-01" )
150+ // Append the backup Type to the bucket key
151+ monthKey := fmt .Sprintf ("%s-%s" , bcpTime .Format ("2006-01" ), bcp .Type )
147152 monthlyCandidates [monthKey ] = append (monthlyCandidates [monthKey ], bcp )
148153 } else {
149154 monthBucket := ageInDays / 30
150- monthKey := fmt .Sprintf ("rolling-month-%d" , monthBucket )
155+ // Append the backup Type to the bucket key
156+ monthKey := fmt .Sprintf ("rolling-month-%d-%s" , monthBucket , bcp .Type )
151157 monthlyCandidates [monthKey ] = append (monthlyCandidates [monthKey ], bcp )
152158 }
153159 }
0 commit comments