Skip to content

repo-updater: respect PG_* env vars specified on the frontend via ServiceConnections

Warren Gifford requested to merge sg/repo-updater-serviceconnection into master

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:

Quick notes about the restart logic:

  1. 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.
  2. 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.
  3. 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:

Merge request reports

Loading