Skip to content

Commit 8f9fb6f

Browse files
authored
K8SPG-613: add unit-test (#1204)
* K8SPG-613: add unit-test https://perconadev.atlassian.net/browse/K8SPG-613 * address comments * cover pgbackrest
1 parent 8a4d0b7 commit 8f9fb6f

File tree

2 files changed

+465
-4
lines changed

2 files changed

+465
-4
lines changed

percona/controller/pgbackup/controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,11 @@ func updatePGBackrestInfo(ctx context.Context, c client.Client, pod *corev1.Pod,
490490
return nil
491491
}
492492
}
493-
return errors.New("backup annotations are not found in pgbackrest")
493+
log := logging.FromContext(ctx)
494+
// We should log error here instead of returning it
495+
// to allow deletion of the backup in the Starting/Running state
496+
log.Error(nil, "backup annotations are not found in pgbackrest")
497+
return nil
494498
}
495499

496500
func finishBackup(ctx context.Context, c client.Client, pgBackup *v2.PerconaPGBackup, job *batchv1.Job) (*reconcile.Result, error) {

0 commit comments

Comments
 (0)