-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix delete BackupPolicy error #276
Conversation
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
backup/backup.go
Outdated
@@ -418,7 +418,7 @@ func (bm *BackupManager) backupBinlog(ctx context.Context, op bkop.Operator) err | |||
pw2 = nil | |||
|
|||
bw := &ByteCountWriter{} | |||
key := calcKey(bm.cluster.Namespace, bm.cluster.Name, constants.BinlogFilename, lastBackup.Time.Time) | |||
key := calcKey(bm.cluster.Namespace, bm.cluster.Name, constants.BinlogFilename, lastBackup.Time.Time.UTC()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug by itself that is worth another issue or PR.
Also, I think the conversion to UTC should happen in calcKey
because by doing so, any use of calcKey
is protected.
In fact, there is another use of calcKey
in this same file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. Will create another PR for it, and convert time zone inside calcKey
.
backup/integration_test.go
Outdated
@@ -194,7 +194,7 @@ var _ = Describe("Backup/Restore", func() { | |||
Expect(bc.contents).To(HaveLen(1)) | |||
|
|||
time.Sleep(1100 * time.Millisecond) | |||
restorePoint := time.Now() | |||
restorePoint := time.Now().UTC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this conversion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary. Will revert.
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Yusuke Suzuki yusuke-suzuki@cybozu.co.jp