From f003b04533a45631483c93a95325103af1d18358 Mon Sep 17 00:00:00 2001 From: Radovan Zvoncek Date: Mon, 2 Dec 2024 11:43:16 +0200 Subject: [PATCH] Return reconcile.TerminalError if getBackupSummary originates the error --- controllers/medusa/medusabackupjob_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/medusa/medusabackupjob_controller.go b/controllers/medusa/medusabackupjob_controller.go index ebdbd4a3d..80a676818 100644 --- a/controllers/medusa/medusabackupjob_controller.go +++ b/controllers/medusa/medusabackupjob_controller.go @@ -18,7 +18,6 @@ package medusa import ( "context" - "errors" "fmt" "net" "strings" @@ -34,6 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/go-logr/logr" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" @@ -253,7 +253,7 @@ func (r *MedusaBackupJobReconciler) getBackupSummary(ctx context.Context, backup } } } - return nil, errors.New("backup summary couldn't be found") + return nil, reconcile.TerminalError(fmt.Errorf("backup summary couldn't be found")) } func (r *MedusaBackupJobReconciler) createMedusaBackup(ctx context.Context, backup *medusav1alpha1.MedusaBackupJob, backupSummary *medusa.BackupSummary, logger logr.Logger) error {