Skip to content

Commit bf7474f

Browse files
authored
add username to pgadmin secret (#3757)
1 parent f6b9f11 commit bf7474f

File tree

1 file changed

+7
-0
lines changed
  • internal/controller/standalone_pgadmin

1 file changed

+7
-0
lines changed

internal/controller/standalone_pgadmin/secret.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package standalone_pgadmin
1616

1717
import (
1818
"context"
19+
"fmt"
1920

2021
"github.com/pkg/errors"
2122
corev1 "k8s.io/api/core/v1"
@@ -71,6 +72,12 @@ func secret(pgadmin *v1beta1.PGAdmin, existing *corev1.Secret) (*corev1.Secret,
7172
})
7273

7374
intent.Data = make(map[string][]byte)
75+
intent.StringData = make(map[string]string)
76+
77+
// The username format is hardcoded,
78+
// but append the full username to the secret for visibility
79+
intent.StringData["username"] = fmt.Sprintf("admin@%s.%s.svc",
80+
pgadmin.Name, pgadmin.Namespace)
7481

7582
// Copy existing password into the intent
7683
if existing.Data != nil {

0 commit comments

Comments
 (0)