From 315b1ae26c021f1fa4d2cf080f0f1a6b757ce5c4 Mon Sep 17 00:00:00 2001 From: bfabricio Date: Tue, 17 Dec 2024 11:07:13 -0300 Subject: [PATCH] PTEUDO-2177: migration to exist source should not error --- pkg/databaseclaim/secrets.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/databaseclaim/secrets.go b/pkg/databaseclaim/secrets.go index 4e0b8aa..9d64499 100644 --- a/pkg/databaseclaim/secrets.go +++ b/pkg/databaseclaim/secrets.go @@ -45,8 +45,8 @@ func (r *DatabaseClaimReconciler) createOrUpdateSecret(ctx context.Context, dbCl Name: secretName, }, gs) - if dbClaim.Status.ActiveDB.ConnectionInfo == nil && err == nil { - return fmt.Errorf("secret %s already exists in namespace %s, but no active database connection info is available", secretName, dbClaim.Namespace) + if dbClaim.Status.ActiveDB.ConnectionInfo == nil && err == nil && dbClaim.Spec.UseExistingSource == nil && !*dbClaim.Spec.UseExistingSource { + return fmt.Errorf("secret %s already exists in namespace %s, but no active database connection info is available", secretName, dbClaim.Namespace) } if err != nil && errors.IsNotFound(err) {