Closed elprans closed 3 years ago
I think we should move functions
Fair enough.
OK, I reorganized the entrypoint to source functions and dropped the need to restart the entire script. Privilege drop is now applied granularly on server/CLI invocations.
Changes:
Add
edbdocker_check_instance
callbackThe
edbdocker_check_instance
is intended to be overloaded in a derived image to check the validity of an existing database instance, e.g. to check catalog version compatibility.Make
edbdocker_run_temp_server()
non-fatal by itselfCurrently,
edbdocker_run_temp_server()
callsdie
on all errors. To allow uses where server failure is expected, delegate the decision to abort the whole thing to the abort callback.Fix entrypoint sourcing
Two fixes:
$FUNCNAME
is only defined inside a function, so make_is_sourced
$BASH_SOURCE
when restarting to drop privilegesApply migrations during bootstrap instead of restarting server
Remove the need to restart the server to apply the migrations when bootstrapping a new instance.