From 547a6c4dc18d55967a1e6fbdbffce6aff4f894ec Mon Sep 17 00:00:00 2001 From: Everton Calgarotto <168137727+EvertonCalgarotto@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:27:05 -0300 Subject: [PATCH] change namespace where secret is read from (#313) --- pkg/databaseclaim/gcpprovider.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/databaseclaim/gcpprovider.go b/pkg/databaseclaim/gcpprovider.go index d00db96f..0f30c670 100644 --- a/pkg/databaseclaim/gcpprovider.go +++ b/pkg/databaseclaim/gcpprovider.go @@ -65,10 +65,15 @@ func (r *DatabaseClaimReconciler) createSecretWithConnInfo(ctx context.Context, return err } + serviceNS, err := r.getServiceNamespace() + if err != nil { + return err + } + var secret = &corev1.Secret{} err = r.Client.Get(ctx, client.ObjectKey{ Name: dbHostIdentifier, - Namespace: dbclaim.Namespace, + Namespace: serviceNS, }, secret) if err != nil { return err