Skip to content

Commit 7a95e88

Browse files
committed
Add DEFAULT_BINARY_PATH to standalone pgadmin startup script.
1 parent 49bb316 commit 7a95e88

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/controller/standalone_pgadmin/pod.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ func startupCommand() []string {
319319
ldapPasswordAbsolutePath = configMountPath + "/" + ldapFilePath
320320

321321
configSystem = `
322-
import json, re, os
322+
import glob, json, re, os
323+
DEFAULT_BINARY_PATHS = {'pg': sorted([''] + glob.glob('/usr/pgsql-*/bin')).pop()}
323324
with open('` + configMountPath + `/` + configFilePath + `') as _f:
324325
_conf, _data = re.compile(r'[A-Z_]+'), json.load(_f)
325326
if type(_data) is dict:

internal/controller/standalone_pgadmin/pod_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ initContainers:
110110
(umask a-w && echo "$1" > /etc/pgadmin/config_system.py)
111111
- startup
112112
- |
113-
import json, re, os
113+
import glob, json, re, os
114+
DEFAULT_BINARY_PATHS = {'pg': sorted([''] + glob.glob('/usr/pgsql-*/bin')).pop()}
114115
with open('/etc/pgadmin/conf.d/~postgres-operator/pgadmin-settings.json') as _f:
115116
_conf, _data = re.compile(r'[A-Z_]+'), json.load(_f)
116117
if type(_data) is dict:
@@ -242,7 +243,8 @@ initContainers:
242243
(umask a-w && echo "$1" > /etc/pgadmin/config_system.py)
243244
- startup
244245
- |
245-
import json, re, os
246+
import glob, json, re, os
247+
DEFAULT_BINARY_PATHS = {'pg': sorted([''] + glob.glob('/usr/pgsql-*/bin')).pop()}
246248
with open('/etc/pgadmin/conf.d/~postgres-operator/pgadmin-settings.json') as _f:
247249
_conf, _data = re.compile(r'[A-Z_]+'), json.load(_f)
248250
if type(_data) is dict:

0 commit comments

Comments
 (0)