DB Upgrade/Downgrade & Initialization
A couple of goals:
Ensure the DB has been initialized and loaded (with policy types, PdpGroups, etc.) before Policy components that are dependent on them are started
Ensure data is added in appropriate dependency order (e.g., policy types before PdpGroups)
Provide a mechanism to upgrade & downgrade DB tables and data from previous installations
Prevent Policy components from exiting just because the DB pod is not running yet
Currently, OOM is configured to perform some DB initialization before other Policy components are started. This should satisfy #3 and provides a hook for #1. However, while this step creates various DB tables, it does not preload any data. As the data preload is currently done by each component (e.g., API & PAP), that does not satisfy #1a. One suggestion is to move the data preload out of the Policy components and make it part of this DB initialization step.
Item #2 could also be addressed, potentially via the DB initialization step part of OOM. That would require some more thought and investigation.