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

carlisia
Copy link
Contributor

@carlisia carlisia commented Apr 23, 2019

In lieu of #629

Fixes #623

Notes:

ncdc and others added 5 commits April 22, 2019 15:22
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
Signed-off-by: Carlisia <carlisiac@vmware.com>
Signed-off-by: Carlisia <carlisiac@vmware.com>
Signed-off-by: Carlisia <carlisiac@vmware.com>
Signed-off-by: Carlisia <carlisiac@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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 Show resolved Hide resolved
Signed-off-by: Carlisia <carlisiac@vmware.com>
Signed-off-by: Carlisia <carlisiac@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

pkg/cloudprovider/aws/object_store.go Outdated Show resolved Hide resolved
pkg/cloudprovider/gcp/object_store.go Outdated Show resolved Hide resolved
Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss
Copy link
Member

skriss commented Apr 24, 2019

code LGTM, just waiting on testing

@skriss
Copy link
Member

skriss 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
Copy link
Contributor Author

Sweet!!! @ncdc did great work!

Signed-off-by: Carlisia <carlisiac@vmware.com>
@skriss
Copy link
Member

skriss 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).

Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrb
Copy link
Contributor

nrb 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 vmware-tanzu:master Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disallow overwriting objects in object storage
4 participants