Move size reservations to a dedicated table. #576
Merged
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.
Now that we would like to offer size reservations directly to customers, it appears that managing all the size reservations inside a slice of a size is quite complicated.
For just operator-usage this is fine, but if you want to select specific reservation entities, it's quite difficult for individual projects that do not have access to the entire reservation slice. It leads to CLI commands like
machine-reservation describe <partition> <project> <size>
in order to correctly identify a reservation (see GenericCLI PR here). But then it's still quite hard to select the proper reservation because you need to introduce implicit conventions for uniqueness. What it really lacks is an identifier.In order to solve this, we should just treat the entity like any other and put it into a dedicated table. We can then also just have regular CRUD endpoints for the entity, which makes it easier to handle.
This is unfortunately a breaking change because the size reservations move away from the size entity. But for now only operators have been using this feature, so a breaking change should not have such a big impact on this resource.
Breaking Change