Skip to content

Commit 4292149

Browse files
committed
1 parent d3f30fd commit 4292149

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

percona/controller/pgcluster/backup.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package pgcluster
22

33
import (
44
"context"
5+
"strings"
56

67
"github.com/pkg/errors"
78
batchv1 "k8s.io/api/batch/v1"
@@ -71,7 +72,8 @@ func (r *PGClusterReconciler) cleanupOutdatedBackups(ctx context.Context, cr *v2
7172

7273
readyPod, err := controller.GetReadyInstancePod(ctx, r.Client, cr.Name, cr.Namespace)
7374
if err != nil {
74-
return errors.Wrap(err, "get ready instance pod")
75+
log.Info("No ready instance pod found, skipping backup cleanup", "repo", repo.Name, "reason", err.Error())
76+
continue
7577
}
7678
info, err = pgbackrest.GetInfo(ctx, readyPod, repo.Name)
7779
if err != nil {
@@ -83,6 +85,10 @@ func (r *PGClusterReconciler) cleanupOutdatedBackups(ctx context.Context, cr *v2
8385
log.Info("pgBackRest stanza not yet created, skipping backup cleanup", "repo", repo.Name)
8486
continue
8587
}
88+
if strings.Contains(err.Error(), "container not found") {
89+
log.Info("Container not ready, skipping backup cleanup", "repo", repo.Name, "reason", err.Error())
90+
continue
91+
}
8692
return errors.Wrap(err, "get pgBackRest info")
8793
}
8894

0 commit comments

Comments
 (0)