repo-updater: respect PG_* env vars specified on the frontend via ServiceConnections
Created by: slimsag
This PR causes repo-updater to respect the PG_* env vars specified on the frontend, such that in all deployments of Sourcegraph the new repo-updater reliance on postgres does not require configuring repo-updater with access to postgres.
After this change is deployed, we should revert the two following commits:
- https://github.com/sourcegraph/deploy-sourcegraph/commit/6779d313c60337be9de96f497038f1f3de74c323
- https://github.com/sourcegraph/deploy-sourcegraph/commit/8a945641141608f240cbaa5ae1fd00c81bb38bb8
Quick notes about the restart logic:
- In a perfect world, repo-updater would be smart enough to recreate and use the new DB connection info. This is complex to do, though, so restarting the process is an easy way to achieve the same thing.
- This will work in both cluster (Kubernetes) and server deployments. It will notably, however, not apply in dev environments as we enforce that if one process dies we kill them all (via goreman). This is an OK issue to have I think.
- We use this same restart pattern elsewhere in the codebase, but I couldn't find an example quickly / may have to dig to find it.
Helps #3031 (closed) (leaving that issue open to add more documentation for this)
Test plan: