Skip to content

Commit 3ba479d

Browse files
authored
Merge pull request #7 from fly-apps/fix-cred-usage
Internal connections should use the flypgadmin user
2 parents eff65ec + 1d20cd7 commit 3ba479d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/pgbouncer.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ unix_socket_dir = /tmp
77
auth_user = postgres
88
auth_file = /data/pgbouncer.auth
99

10-
admin_users = postgres
10+
admin_users = postgres,flypgadmin
1111

1212
user = postgres
1313

pkg/flypg/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ func (n *Node) PostInit() error {
280280

281281
func (n *Node) NewPGBouncerConnection(ctx context.Context) (*pgx.Conn, error) {
282282
host := net.JoinHostPort(n.PrivateIP, strconv.Itoa(n.ProxyPort))
283-
return openConnection(ctx, host, "pgbouncer", n.OperatorCredentials)
283+
return openConnection(ctx, host, "pgbouncer", n.SUCredentials)
284284
}
285285

286286
func (n *Node) NewLocalConnection(ctx context.Context) (*pgx.Conn, error) {
287287
host := net.JoinHostPort(n.PrivateIP, strconv.Itoa(n.PGPort))
288-
return openConnection(ctx, host, "postgres", n.OperatorCredentials)
288+
return openConnection(ctx, host, "postgres", n.SUCredentials)
289289
}
290290

291291
func (n *Node) NewRepLocalConnection(ctx context.Context) (*pgx.Conn, error) {

0 commit comments

Comments
 (0)