mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 22:23:15 +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:
@@ -49,6 +49,7 @@ import (
|
||||
"github.com/heptio/ark/pkg/util/collections"
|
||||
"github.com/heptio/ark/pkg/util/encode"
|
||||
kubeutil "github.com/heptio/ark/pkg/util/kube"
|
||||
"github.com/heptio/ark/pkg/util/stringslice"
|
||||
)
|
||||
|
||||
const backupVersion = 1
|
||||
@@ -237,8 +238,8 @@ func (controller *backupController) processBackup(key string) error {
|
||||
backup.Status.Version = backupVersion
|
||||
|
||||
// add GC finalizer if it's not there already
|
||||
if !has(backup.Finalizers, gcFinalizer) {
|
||||
backup.Finalizers = append(backup.Finalizers, gcFinalizer)
|
||||
if !stringslice.Has(backup.Finalizers, api.GCFinalizer) {
|
||||
backup.Finalizers = append(backup.Finalizers, api.GCFinalizer)
|
||||
}
|
||||
|
||||
// calculate expiration
|
||||
|
||||
Reference in New Issue
Block a user