feat(storage): add index to schema#1748
Closed
joseivanlopez wants to merge 11 commits intoagama-project:storage-config-uifrom
Closed
feat(storage): add index to schema#1748joseivanlopez wants to merge 11 commits intoagama-project:storage-config-uifrom
joseivanlopez wants to merge 11 commits intoagama-project:storage-config-uifrom
Conversation
Pull Request Test Coverage Report for Build 11800402213Details
💛 - Coveralls |
e8aa831 to
75484a9
Compare
- Add #index. - Use unsolved drive info.
- Add #index and #resize. - Use unsolved partition info.
- Add #auto. - Use unsolved config info.
75484a9 to
40c1676
Compare
Contributor
|
I'm just starting, but I admit I didn't expect to see the indexes on the schema. Feels like leaking an internal implementation detail. |
Contributor
Author
|
After some discussions, we decided to move the config model to the backend. It is easier to implement without the need of adding any artificial properties to the config schema (like the index). Moreover, other clients (e.g., a TUI) could get benefit of the model too. Closing in favor of #1763. |
joseivanlopez
added a commit
that referenced
this pull request
Nov 26, 2024
A config model is an abstraction of the storage config to make easier
for clients to deal with the storage config. Clients (e.g., the web UI)
do not need to understand the complexity of the storage config. Instead
of that, clients directly work with the config model for both reading
the config and applying changes.
Example of storage config:
~~~
{
"drives": [
{
"search": {
"condition": { "name": "/dev/vda" },
"max": 1,
"ifNotFound": "error"
},
"partitions": [
{ "search": "*", "delete": true },
{ "generate": "default" }
]
}
]
}
~~~
And its equivalence in the config model:
~~~
{
"drives": [
{
"name": "/dev/vda",
"spacePolicy": "delete",
"partitions": [
{ "name": "/dev/vda1", "delete": true },
{ "name": "/dev/vda2", "delete": true },
{
"mountPath": "/",
"filesystem": {
"default": true,
"type": "btrfs",
"snapshots": false
},
"size": {
"default": true,
"min": 2048
}
}
]
}
]
}
~~~
Note: this PR replaces #1748
in which the model was implemented in the web side.
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.
Changes: