pb-2325: Set retention period for object-locked Failed backup
The scheduled failed backup which is created for object-locked bucket
need to set retention period appropriately. This helps px-backup to
delete them when auto-delete flag enabled in px-backup.
@@ -401,6 +401,7 @@ func (s *ApplicationBackupScheduleController) startApplicationBackup(backupSched
backup.Status.Status = stork_api.ApplicationBackupStatusFailed
backup.Status.Reason = InsufficientRetentionPeriod
backup.Status.Stage = stork_api.ApplicationBackupStageFinal
+ backup.Annotations[ApplicationBackupObjectLockRetentionAnnotation] = strconv.FormatInt(objectLockInfo.RetentionPeriodDays, 10)
// Don't need to process anything further
_, err = storkops.Instance().CreateApplicationBackup(backup)
return err
