Skip to content
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

Fail backup if it already exists in object storage #1390

Merged
merged 9 commits into from Apr 24, 2019

Conversation

Projects
None yet
4 participants
@carlisia
Copy link
Member

commented Apr 23, 2019

In lieu of #629

Fixes #623

Notes:

ncdc and others added some commits Jun 29, 2018

Fail backup if it already exists in object storage
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
Code clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
More clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
Fix test?
Signed-off-by: Carlisia <carlisiac@vmware.com>
Add back code and tests
Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss
Copy link
Contributor

left a comment

initial review. I can sign up for Azure testing since I have a cluster up and running

Show resolved Hide resolved pkg/cloudprovider/aws/object_store.go Outdated
Show resolved Hide resolved pkg/cloudprovider/aws/object_store_test.go Outdated
Show resolved Hide resolved pkg/cloudprovider/azure/object_store_test.go Outdated
Show resolved Hide resolved pkg/cloudprovider/gcp/object_store.go Outdated
Show resolved Hide resolved pkg/cloudprovider/in_memory_object_store.go Outdated
Show resolved Hide resolved pkg/controller/backup_controller.go Outdated
Show resolved Hide resolved pkg/controller/backup_controller_test.go Outdated
Show resolved Hide resolved pkg/controller/backup_controller_test.go Outdated
Show resolved Hide resolved pkg/controller/backup_controller_test.go Outdated
Show resolved Hide resolved pkg/plugin/framework/object_store_server.go Outdated

@carlisia carlisia requested a review from nrb Apr 24, 2019

Address code review
Signed-off-by: Carlisia <carlisiac@vmware.com>
Revert
Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss
Copy link
Contributor

left a comment

Two small comments, otherwise LGTM. Please add a changelog file as well!

Show resolved Hide resolved pkg/cloudprovider/aws/object_store.go Outdated
Show resolved Hide resolved pkg/cloudprovider/gcp/object_store.go Outdated
Clean up + changelog
Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

code LGTM, just waiting on testing

@skriss

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

After locally fixing the first comment from above, I was able to confirm that on Azure, backups correctly fail if there's already a backups/<backup-name>/velero-backup.json in object storage, and if that's not the case, they proceed.

@carlisia

This comment has been minimized.

Copy link
Member Author

commented Apr 24, 2019

Sweet!!! @ncdc did great work!

Bug fix
Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

An observation: in the case that this code is intended to catch, we end up with a Failed backup in-cluster. So, now, if I velero backup delete this backup -- the files in object storage get deleted. However, this almost certainly wasn't my intent, since those files in object storage weren't created by this backup I just created.

I'm guessing that to fix this, we'll need to add velero-managed UIDs to backups, so that we have a unique ID for each backup across time and space that we can use to determine if two items are the same or not. I don't think it's in scope for this PR, but we should follow up on it. It's somewhat related to #629 (comment).

@skriss

skriss approved these changes Apr 24, 2019

Copy link
Contributor

left a comment

LGTM

@nrb

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

The UID fix seems reasonable to me. I briefly wondered if it would then be better to use those identifiers on the object storage vs the user-provided name, as that would remove the need for this code. However, that's too invasive a change at this stage, so I'm for just attaching it and using it on sync comparison.

@nrb nrb merged commit 58bb7ed into heptio:master Apr 24, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
signed-off-by Commit has Signed-off-by
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.