fix: modify generated from schedule's backup name timestamp to UTC ti… (#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 <jxun@vmware.com>

* 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 <jxun@vmware.com>

* 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 <jxun@vmware.com>

* modify changelog description

Reword the changelog description according to comments.

Signed-off-by: Xun Jiang <jxun@vmware.com>

Co-authored-by: jxun <jxun@jxun-a01.vmware.com>
Co-authored-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
Xun Jiang/Bruce Jiang
2021-11-17 09:26:49 -05:00
committed by GitHub
co-authored by jxun Xun Jiang
parent 5150ce4891
commit fc29294552
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
Modify the timestamp in the name of a backup generated from schedule to use UTC.
+1 -1
View File
@@ -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)