Skip to content

Commit

Permalink
fix: modify generated from schedule's backup name timestamp to UTC ti… (
Browse files Browse the repository at this point in the history
#4353)

* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <[email protected]>

* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <[email protected]>

* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <[email protected]>

* modify changelog description

Reword the changelog description according to comments.

Signed-off-by: Xun Jiang <[email protected]>

Co-authored-by: jxun <[email protected]>
Co-authored-by: Xun Jiang <[email protected]>
  • Loading branch information
3 people authored Nov 17, 2021
1 parent 5150ce4 commit fc29294
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/unreleased/4353-jxun
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modify the timestamp in the name of a backup generated from schedule to use UTC.
2 changes: 1 addition & 1 deletion pkg/cmd/cli/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (o *CreateOptions) BuildBackup(namespace string) (*velerov1api.Backup, erro
return nil, err
}
if o.Name == "" {
o.Name = schedule.TimestampedName(time.Now())
o.Name = schedule.TimestampedName(time.Now().UTC())
}
backupBuilder = builder.ForBackup(namespace, o.Name).
FromSchedule(schedule)
Expand Down

0 comments on commit fc29294

Please sign in to comment.