File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,13 +14,22 @@ var (
1414 dbWait = utils .PodConfig .GetString ("wait_for_db" , "empty" )
1515)
1616
17- func ConfigureApp () {
17+ func configureBaseApp () {
1818 utils .ConfigureLogging ()
19- database .Configure ()
2019 metrics .Configure ()
2120 database .DBWait (dbWait )
2221}
2322
23+ func ConfigureApp () {
24+ database .Configure ()
25+ configureBaseApp ()
26+ }
27+
28+ func ConfigureAdminApp () {
29+ database .ConfigureAdmin ()
30+ configureBaseApp ()
31+ }
32+
2433func SetupTestEnvironment () {
2534 utils .SetDefaultEnvOrFail ("LOG_LEVEL" , "debug" )
2635 ConfigureApp ()
Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ func Configure() {
5656 loadAdditionalParamsFromDB ()
5757}
5858
59+ func ConfigureAdmin () {
60+ InitDB (Admin )
61+ loadAdditionalParamsFromDB ()
62+ }
63+
5964// PostgreSQLConfig PostgreSQL database config
6065type PostgreSQLConfig struct {
6166 Host string
Original file line number Diff line number Diff line change 66)
77
88func main () {
9- database .InitDB ()
9+ database .InitDB (database . Admin )
1010 if len (os .Args ) > 1 {
1111 switch os .Args [1 ] {
1212 case "inventory_hosts" :
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import (
2424
2525// @BasePath /api/patch/admin
2626func RunAdminAPI () {
27- core .ConfigureApp ()
27+ core .ConfigureAdminApp ()
2828
2929 // Toggle Turnpike authentication for internal API (manual sync, re-calc)
3030 enableTurnpikeAuth := utils .PodConfig .GetBool ("turnpike_auth" , true )
You can’t perform that action at this time.
0 commit comments