mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 13:05:17 +00:00
Allow forced backup deletion
Add --force and --confirm to `ark backup delete` to support forced backup deletion. This forcibly removes the Ark GC finalizer (if it's present) from a backup and will orphan any resources associated with the backup, such as backup tarballs in object storage, persistent volume snapshots, and restores for the backup. If a backup has a deletion timestamp, display `Deleting` in `ark backup describe` and `ark backup get`. Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
@@ -306,17 +306,17 @@ func TestHandleFinalizer(t *testing.T) {
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).Backup,
|
||||
},
|
||||
{
|
||||
name: "no gcFinalizer exits early",
|
||||
name: "no GCFinalizer exits early",
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).WithFinalizers("foo").Backup,
|
||||
},
|
||||
{
|
||||
name: "error when calling garbageCollect exits without patch",
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).WithFinalizers(gcFinalizer).Backup,
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).WithFinalizers(api.GCFinalizer).Backup,
|
||||
deleteBackupDirError: true,
|
||||
},
|
||||
{
|
||||
name: "normal case - patch includes the appropriate fields",
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).WithFinalizers(gcFinalizer, "foo").WithResourceVersion("1").Backup,
|
||||
backup: arktest.NewTestBackup().WithDeletionTimestamp(time.Now()).WithFinalizers(api.GCFinalizer, "foo").WithResourceVersion("1").Backup,
|
||||
expectGarbageCollect: true,
|
||||
expectedPatch: []byte(`{"metadata":{"finalizers":["foo"],"resourceVersion":"1"}}`),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user