From 10d2dd83ad1aaa057cfda50665b4135c10abd9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Carr=C3=A8re?= Date: Fri, 5 Apr 2019 16:41:01 +0100 Subject: [PATCH] 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. --- pkg/backup/backup_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/backup/backup_manager.go b/pkg/backup/backup_manager.go index a82ae32eb..3c1af3782 100644 --- a/pkg/backup/backup_manager.go +++ b/pkg/backup/backup_manager.go @@ -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 {