@@ -75,7 +75,7 @@ var flags = []cli.Flag{
7575 },
7676 & cli.StringFlag {
7777 Name : "postgres-dsn" ,
78- Value : "postgres://localhost:5432/postgres?sslmode=disable" ,
78+ Value : "postgres://postgres:postgres@ localhost:5432/postgres?sslmode=disable" ,
7979 Usage : "Postgres DSN" ,
8080 EnvVars : []string {"POSTGRES_DSN" },
8181 },
@@ -118,6 +118,7 @@ func runCli(cCtx *cli.Context) error {
118118 logService := cCtx .String ("log-service" )
119119 enablePprof := cCtx .Bool ("pprof" )
120120 drainDuration := time .Duration (cCtx .Int64 ("drain-seconds" )) * time .Second
121+ mockSecretsStorage := cCtx .Bool ("mock-secrets" )
121122
122123 logTags := map [string ]string {
123124 "version" : common .Version ,
@@ -134,6 +135,9 @@ func runCli(cCtx *cli.Context) error {
134135 RequestHeaders : true ,
135136 Tags : logTags ,
136137 })
138+
139+ log .With ("version" , common .Version ).Info ("starting builder-hub" )
140+
137141 db , err := database .NewDatabaseService (cCtx .String ("postgres-dsn" ))
138142 if err != nil {
139143 log .Error ("failed to create database" , "err" , err )
@@ -143,14 +147,15 @@ func runCli(cCtx *cli.Context) error {
143147
144148 var sm ports.AdminSecretService
145149
146- if ! cCtx .Bool ("mock-secrets" ) {
150+ if mockSecretsStorage {
151+ log .Info ("using mock secrets storage" )
152+ sm = domain .NewMockSecretService ()
153+ } else {
147154 sm , err = secrets .NewService (cCtx .String ("secret-name" ))
148155 if err != nil {
149156 log .Error ("failed to create secrets manager" , "err" , err )
150157 return err
151158 }
152- } else {
153- sm = domain .NewMockSecretService ()
154159 }
155160
156161 builderHub := application .NewBuilderHub (db , sm )
0 commit comments