Skip to content

Commit

Permalink
Merge pull request improbable-eng#38 from digitalocean/varsha/eco-cle…
Browse files Browse the repository at this point in the history
…anup

delete old backup objects only if successfully completed
  • Loading branch information
Varsha Varadarajan authored and GitHub Enterprise committed Apr 20, 2022
2 parents cd13dd3 + 5929559 commit b8432f3
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 b8432f3

Please sign in to comment.