Skip to content

Commit

Permalink
Fix RabbitMQ authsecret name
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <raihan@appscode.com>
  • Loading branch information
raihankhan committed Dec 17, 2024
1 parent f9bb8f9 commit 49280dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apis/kubedb/v1alpha2/rabbitmq_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"path/filepath"
"slices"
"strings"

"kubedb.dev/apimachinery/apis"
catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 49280dd

Please sign in to comment.