Skip to content

Commit ee8fe79

Browse files
committed
put back const rather than var
1 parent 0d665b0 commit ee8fe79

File tree

1 file changed

+16
-16
lines changed
  • internal/controller/standalone_pgadmin

1 file changed

+16
-16
lines changed

internal/controller/standalone_pgadmin/pod.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func startupScript(pgadmin *v1beta1.PGAdmin) []string {
270270
// - https://www.pgadmin.org/docs/pgadmin4/development/server_deployment.html#standalone-gunicorn-configuration
271271
// - https://docs.gunicorn.org/en/latest/configure.html
272272
var startScript = fmt.Sprintf(`
273-
export PGADMIN_SETUP_PASSWORD="$(date +%%s | sha256sum | base64 | head -c 32)"
273+
export PGADMIN_SETUP_PASSWORD="admin"
274274
PGADMIN_DIR=%s
275275
APP_RELEASE=$(cd $PGADMIN_DIR && python3 -c "import config; print(config.APP_RELEASE)")
276276
@@ -365,11 +365,10 @@ func startupCommand() []string {
365365

366366
// configDatabaseURIPath is the path for mounting the database URI connection string
367367
configDatabaseURIPathAbsolutePath = configMountPath + "/" + configDatabaseURIPath
368-
)
369368

370-
// The values set in configSystem will not be overridden through
371-
// spec.config.settings.
372-
var configSystem = `
369+
// The values set in configSystem will not be overridden through
370+
// spec.config.settings.
371+
configSystem = `
373372
import glob, json, re, os
374373
DEFAULT_BINARY_PATHS = {'pg': sorted([''] + glob.glob('/usr/pgsql-*/bin')).pop()}
375374
with open('` + configMountPath + `/` + configFilePath + `') as _f:
@@ -384,24 +383,25 @@ if os.path.isfile('` + configDatabaseURIPathAbsolutePath + `'):
384383
CONFIG_DATABASE_URI = _f.read()
385384
`
386385

387-
// Gunicorn reads from the `/etc/pgadmin/gunicorn_config.py` file during startup
388-
// after all other config files.
389-
// - https://docs.gunicorn.org/en/latest/configure.html#configuration-file
390-
//
391-
// This command writes a script in `/etc/pgadmin/gunicorn_config.py` that reads
392-
// from the `gunicorn-config.json` file and sets those variables globally.
393-
// That way those values are available as settings when Gunicorn starts.
394-
//
395-
// Note: All Gunicorn settings are lowercase with underscores, so ignore
396-
// any keys/names that are not.
397-
var gunicornConfig = `
386+
// Gunicorn reads from the `/etc/pgadmin/gunicorn_config.py` file during startup
387+
// after all other config files.
388+
// - https://docs.gunicorn.org/en/latest/configure.html#configuration-file
389+
//
390+
// This command writes a script in `/etc/pgadmin/gunicorn_config.py` that reads
391+
// from the `gunicorn-config.json` file and sets those variables globally.
392+
// That way those values are available as settings when Gunicorn starts.
393+
//
394+
// Note: All Gunicorn settings are lowercase with underscores, so ignore
395+
// any keys/names that are not.
396+
gunicornConfig = `
398397
import json, re, gunicorn
399398
gunicorn.SERVER_SOFTWARE = 'Python'
400399
with open('` + configMountPath + `/` + gunicornConfigFilePath + `') as _f:
401400
_conf, _data = re.compile(r'[a-z_]+'), json.load(_f)
402401
if type(_data) is dict:
403402
globals().update({k: v for k, v in _data.items() if _conf.fullmatch(k)})
404403
`
404+
)
405405

406406
args := []string{strings.TrimLeft(configSystem, "\n"), strings.TrimLeft(gunicornConfig, "\n")}
407407

0 commit comments

Comments
 (0)