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

Remove backups and restic repos associated with deleted BSL(s) #4377

Conversation

codegold79
Copy link
Contributor

@codegold79 codegold79 commented Nov 20, 2021

Signed-off-by: F. Gold fgold@vmware.com

Summary of change

Added cli logic to look for backups and restic repositories that have the velero.io/storage-location=<deleted-bsl-name> label. The Velero client will then delete those backup and restic repos.

Regarding tests, I added expectations in @danfengliu's test cases plan where a BSL is deleted (I believe the test case documentation will be published to this Velero repo soon, after it's completed).

I looked for documentation to change, but there is nothing mentioned about deleting BSLs and so nothing to update.

Change fixes an issue

Fixes #2082

Please indicate you've done the following:

Copy link
Contributor

@jenting jenting left a comment

Choose a reason for hiding this comment

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

Question: will remove the backup, Velero deletes the backup CR only? Or will Velero also deletes the remote backup file?

@codegold79
Copy link
Contributor Author

codegold79 commented Nov 22, 2021

@jenting asked,

Question: will remove the backup, Velero deletes the backup CR only? Or will Velero also deletes the remote backup file?

This change will only delete the backup and Restic repository CRs only. The actual backup tarballs in the BSL will be retained.

Here was my design doc: #4297

Copy link
Contributor

@dsu-igeek dsu-igeek left a comment

Choose a reason for hiding this comment

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

Please make sure to not use the bad return values

pkg/cmd/cli/backuplocation/delete.go Outdated Show resolved Hide resolved
pkg/cmd/cli/backuplocation/delete.go Outdated Show resolved Hide resolved
Signed-off-by: F. Gold <fgold@vmware.com>
Signed-off-by: F. Gold <fgold@vmware.com>
Signed-off-by: F. Gold <fgold@vmware.com>
Signed-off-by: F. Gold <fgold@vmware.com>
…errors

Signed-off-by: F. Gold <fgold@vmware.com>
@codegold79 codegold79 force-pushed the 2082-delete-associated-backup-and-restic-repos-when-bsl-deleted branch from aa30a4d to b6575f5 Compare November 30, 2021 01:41
Copy link
Contributor

@ywk253100 ywk253100 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@dsu-igeek dsu-igeek left a comment

Choose a reason for hiding this comment

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

lgtm

@dsu-igeek dsu-igeek merged commit d3c7ef0 into vmware-tanzu:main Dec 14, 2021
danfengliu pushed a commit to danfengliu/velero that referenced this pull request Jan 25, 2022
…e-tanzu#4377)

* Remove backups and restic repos associated with deleted BSL(s)

Signed-off-by: F. Gold <fgold@vmware.com>

* add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Add PR number to changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Fix typo

Signed-off-by: F. Gold <fgold@vmware.com>

* Only delete backups and restic repos and report success when without errors

Signed-off-by: F. Gold <fgold@vmware.com>
gyaozhou pushed a commit to gyaozhou/velero-read that referenced this pull request May 14, 2022
…e-tanzu#4377)

* Remove backups and restic repos associated with deleted BSL(s)

Signed-off-by: F. Gold <fgold@vmware.com>

* add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Add PR number to changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Fix typo

Signed-off-by: F. Gold <fgold@vmware.com>

* Only delete backups and restic repos and report success when without errors

Signed-off-by: F. Gold <fgold@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when a backup storage location is deleted, remove associated backups & restic repos from the cluster
4 participants