From 49280dd063748a6a9bdd54a6db29adeefbdb48d9 Mon Sep 17 00:00:00 2001 From: raihankhan Date: Tue, 17 Dec 2024 10:48:33 +0600 Subject: [PATCH] Fix RabbitMQ authsecret name Signed-off-by: raihankhan --- apis/kubedb/v1alpha2/rabbitmq_helpers.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apis/kubedb/v1alpha2/rabbitmq_helpers.go b/apis/kubedb/v1alpha2/rabbitmq_helpers.go index 35384a26fa..ae3ae78086 100644 --- a/apis/kubedb/v1alpha2/rabbitmq_helpers.go +++ b/apis/kubedb/v1alpha2/rabbitmq_helpers.go @@ -21,7 +21,6 @@ import ( "fmt" "path/filepath" "slices" - "strings" "kubedb.dev/apimachinery/apis" catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1" @@ -78,7 +77,7 @@ func (r *RabbitMQ) GetAuthSecretName() string { if r.Spec.AuthSecret != nil && r.Spec.AuthSecret.Name != "" { return r.Spec.AuthSecret.Name } - return meta_util.NameWithSuffix(r.OffshootName(), "auth") + return r.DefaultUserCredSecretName() } func (r *RabbitMQ) GetPersistentSecrets() []string { @@ -228,8 +227,8 @@ func (r *RabbitMQ) ConfigSecretName() string { return meta_util.NameWithSuffix(r.OffshootName(), "config") } -func (r *RabbitMQ) DefaultUserCredSecretName(username string) string { - return meta_util.NameWithSuffix(r.Name, strings.ReplaceAll(fmt.Sprintf("%s-cred", username), "_", "-")) +func (r *RabbitMQ) DefaultUserCredSecretName() string { + return meta_util.NameWithSuffix(r.OffshootName(), "auth") } func (r *RabbitMQ) DefaultErlangCookieSecretName() string {