mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 03:35:22 +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:
@@ -190,7 +190,7 @@ func TestProcessBackup(t *testing.T) {
|
||||
backup.Status.Phase = v1.BackupPhaseInProgress
|
||||
backup.Status.Expiration.Time = expiration
|
||||
backup.Status.Version = 1
|
||||
backup.Finalizers = []string{gcFinalizer}
|
||||
backup.Finalizers = []string{v1.GCFinalizer}
|
||||
backupper.On("Backup", backup, mock.Anything, mock.Anything, mock.Anything).Return(nil)
|
||||
|
||||
cloudBackups.On("UploadBackup", "bucket", backup.Name, mock.Anything, mock.Anything, mock.Anything).Return(nil)
|
||||
@@ -226,7 +226,7 @@ func TestProcessBackup(t *testing.T) {
|
||||
res.Status.Version = 1
|
||||
res.Status.Expiration.Time = expiration
|
||||
res.Status.Phase = v1.BackupPhase(phase)
|
||||
res.Finalizers = []string{gcFinalizer}
|
||||
res.Finalizers = []string{v1.GCFinalizer}
|
||||
|
||||
return true, res, nil
|
||||
})
|
||||
@@ -274,7 +274,7 @@ func TestProcessBackup(t *testing.T) {
|
||||
finalizers, err := collections.GetSlice(patch, "metadata.finalizers")
|
||||
require.NoError(t, err, "patch does not contain metadata.finalizers")
|
||||
assert.Equal(t, 1, len(finalizers))
|
||||
assert.Equal(t, gcFinalizer, finalizers[0])
|
||||
assert.Equal(t, v1.GCFinalizer, finalizers[0])
|
||||
|
||||
res, _ = collections.GetMap(patch, "metadata")
|
||||
assert.Equal(t, 1, len(res), "patch's metadata has the wrong number of keys")
|
||||
|
||||
Reference in New Issue
Block a user