Skip to content

Commit

Permalink
add username to pgadmin secret
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjb committed Oct 19, 2023
1 parent 4045861 commit e24d291
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/standalone_pgadmin/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package standalone_pgadmin

import (
"context"
"fmt"

"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -71,6 +72,11 @@ func secret(pgadmin *v1beta1.PGAdmin, existing *corev1.Secret) (*corev1.Secret,
})

intent.Data = make(map[string][]byte)
intent.StringData = make(map[string]string)

// The username is hardcoded, but append to the secret for visibility
intent.StringData["username"] = fmt.Sprintf("admin@%s.%s.svc",
pgadmin.Name, pgadmin.Namespace)

// Copy existing password into the intent
if existing.Data != nil {
Expand Down

0 comments on commit e24d291

Please sign in to comment.