Skip to content

Commit

Permalink
Use .flycast addrs for pg
Browse files Browse the repository at this point in the history
  • Loading branch information
DAlperin committed Mar 1, 2023
1 parent 86f2015 commit dc3a37a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flypg/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (l *Launcher) LaunchMachinesPostgres(ctx context.Context, config *CreateClu
connStr := fmt.Sprintf("postgres://postgres:%s@%s.internal:5432\n", secrets["OPERATOR_PASSWORD"], config.AppName)

if config.Manager == ReplicationManager && addr != nil {
connStr = fmt.Sprintf("postgres://postgres:%s@[%s]:5432\n", secrets["OPERATOR_PASSWORD"], addr.Address)
connStr = fmt.Sprintf("postgres://postgres:%s@%s.flycast:5432\n", secrets["OPERATOR_PASSWORD"], config.AppName)
}

fmt.Fprintf(io.Out, "Postgres cluster %s created\n", config.AppName)
Expand Down
4 changes: 2 additions & 2 deletions internal/command/postgres/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ func runAttachCluster(ctx context.Context, leaderIP string, params AttachParams,
)
if flycast != nil {
connectionString = fmt.Sprintf(
"postgres://%s:%s@[%s]:5432/%s?sslmode=disable",
*input.DatabaseUser, pwd, *flycast, *input.DatabaseName,
"postgres://%s:%s@%s.flycast:5432/%s?sslmode=disable",
*input.DatabaseUser, pwd, input.PostgresClusterAppID, *input.DatabaseName,
)
}
s := map[string]string{}
Expand Down

0 comments on commit dc3a37a

Please sign in to comment.