From 1322fd47a6a530cc3e857b0d695c99b7a8c3e1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Fri, 12 Jul 2024 10:16:12 +0100 Subject: [PATCH] fix: use correct namespace for password secret (#1581) --- controllers/mongodb_users.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/mongodb_users.go b/controllers/mongodb_users.go index 2af312d2c..fd3311011 100644 --- a/controllers/mongodb_users.go +++ b/controllers/mongodb_users.go @@ -62,7 +62,7 @@ func (r ReplicaSetReconciler) updateConnectionStringSecrets(ctx context.Context, pwd := "" if user.Database != constants.ExternalDB { - secretNamespacedName := types.NamespacedName{Name: user.PasswordSecretName, Namespace: secretNamespace} + secretNamespacedName := types.NamespacedName{Name: user.PasswordSecretName, Namespace: mdb.Namespace} pwd, err = secret.ReadKey(ctx, r.client, user.PasswordSecretKey, secretNamespacedName) if err != nil { return err