Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion percona/controller/pgcluster/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pgcluster

import (
"context"
"strings"

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

readyPod, err := controller.GetReadyInstancePod(ctx, r.Client, cr.Name, cr.Namespace)
if err != nil {
return errors.Wrap(err, "get ready instance pod")
log.Info("No ready instance pod found, skipping backup cleanup", "repo", repo.Name, "reason", err.Error())
continue
}
info, err = pgbackrest.GetInfo(ctx, readyPod, repo.Name)
if err != nil {
Expand All @@ -83,6 +85,10 @@ func (r *PGClusterReconciler) cleanupOutdatedBackups(ctx context.Context, cr *v2
log.Info("pgBackRest stanza not yet created, skipping backup cleanup", "repo", repo.Name)
continue
}
if strings.Contains(err.Error(), "container not found") {
log.Info("Container not ready, skipping backup cleanup", "repo", repo.Name, "reason", err.Error())
continue
}
return errors.Wrap(err, "get pgBackRest info")
}

Expand Down
Loading