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
…mezone

fix vmware-tanzu#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]>
  • Loading branch information
jxun committed Nov 16, 2021
1 parent 2376b69 commit 601af6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/cli/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,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 601af6d

Please sign in to comment.