Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit cac5744

Browse files
committed
backup operator: fixed incorrect backup file naming convention.
When limiting the number of backups, if the revision would move to needing another digit, the logic would never select a new entry as _ is > to 9 in ascii terms. Note that this is backwards incompatible as now files receive a correct padding and old revisions will still be incorrectly handled.
1 parent 1060c24 commit cac5744

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/backup/backup_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (bm *BackupManager) SaveSnap(ctx context.Context, s3Path string, isPeriodic
7373
}
7474
defer rc.Close()
7575
if isPeriodic {
76-
s3Path = fmt.Sprintf(s3Path+"_v%d_%s", rev, now.Format("2006-01-02-15:04:05"))
76+
s3Path = fmt.Sprintf(s3Path+"_v%019d_%s", rev, now.Format("2006-01-02-15:04:05"))
7777
}
7878
_, err = bm.bw.Write(ctx, s3Path, rc)
7979
if err != nil {

0 commit comments

Comments
 (0)