Skip to content

Commit

Permalink
delete old backup objects only if successfully completed
Browse files Browse the repository at this point in the history
  • Loading branch information
varshavaradarajan committed Apr 19, 2022
1 parent cd13dd3 commit 5929559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/etcdbackupschedule_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (r *EtcdBackupScheduleReconciler) cleanup(resourceNamespacedName types.Name
for i, backup := range etcdBackups.Items {
backup := backup
funcs[i] = func() error {
if cleanAll || backup.Status.Phase != etcdv1alpha1.EtcdBackupPhaseBackingUp {
if cleanAll || backup.Status.Phase == etcdv1alpha1.EtcdBackupPhaseCompleted {
if err := r.Delete(ctx, &backup); err != nil {
return client.IgnoreNotFound(err)
}
Expand Down

0 comments on commit 5929559

Please sign in to comment.