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

Commit

Permalink
backup operator: fixed incorrect backup file naming convention.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kapouille committed May 16, 2019
1 parent cc2f4e8 commit 10d2dd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/backup/backup_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (bm *BackupManager) SaveSnap(ctx context.Context, s3Path string, isPeriodic
}
defer rc.Close()
if isPeriodic {
s3Path = fmt.Sprintf(s3Path+"_v%d_%s", rev, now.Format("2006-01-02-15:04:05"))
s3Path = fmt.Sprintf(s3Path+"_v%019d_%s", rev, now.Format("2006-01-02-15:04:05"))
}
_, err = bm.bw.Write(ctx, s3Path, rc)
if err != nil {
Expand Down

0 comments on commit 10d2dd8

Please sign in to comment.