Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
PostgresDatabaseResourcethat shifts the Postgres database creation logic to happen later in the database creation process. Now, theInstanceResourceis only responsible for creating the database users, and thePostgresDatabaseresource is responsible for creating the Postgres database, granting role privileges to the new database, and initializing the Spock node.This change is necessary because we need to use
pg_service.conffor SystemD support, and we need that file to exist when we create the Spock node. This change shifts the Spock node initialization until after all of the instances are created and all nodes are ready, so we're able to construct the DSNs for all nodes before we initialize Spock.This change has an added benefit that it opens up the possibility of support for multiple Postgres databases per Control Plane database since we're able to make multiple databases/spock nodes per
NodeResource/Patroni cluster. I've added theDatabaseNamefield to most, if not all, of the resources that would need to change to accommodate this.Testing
There should be no difference in user-facing functionality.
PLAT-417