Repository navigation
Conversation
start creates the management partner and its staff organisation and attaches the first domain to it, so the seeded admin has cluster reach once tenancy enforcement is on. Placeholder rows are created owned by that organisation. Builds and clones migrations from the models tenancy branch until models #332 merges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Clean-install half of multi-tenancy (under PPT-526). Pairs with PlaceOS/models#332 and PlaceOS/rest-api#451. Draft until the set has been through a clean install on the test cluster.
What this does
startcreates the management partner ("PlaceOS",management = true) and its staff organisation (partner_staff = true), and attaches the first domain to that organisation. With enforcement on, the seeded admin therefore has cluster reach from the first boot rather than reaching nothing.create:placeholderstask does the same when a staff organisation exists.shard.override.yml, and the image clones that branch for its migrations, so a clean install from this image applies the tenancy schema.Both seeding steps are idempotent in the same way as the existing ones: existing rows are reused, never changed, except that an unowned first domain is attached.
Verification
crystal build --no-codegenclean forstartandsam.spec/spec_helpers/tenancy.cr) builds the same shape this seeds, and its specs show a staff-organisation admin resolving to cluster reach.Plan: https://gist.github.com/camreeves/3fabfff92bcdef77a1dcb4b8d8ebfe7b