Skip to content

Commit

Permalink
Fix schema
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Jul 1, 2024
1 parent 33397bc commit 6aff4aa
Showing 1 changed file with 90 additions and 47 deletions.
137 changes: 90 additions & 47 deletions rust/agama-lib/share/profile.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://github.com/openSUSE/agama/blob/master/rust/agama-lib/share/profile.schema.json",
"title": "Profile",
"description": "Profile definition for automated installation",
Expand Down Expand Up @@ -96,17 +95,15 @@
"type": "array",
"items": {
"title": "Connection addresses",
"type": "string",
"additionalProperties": false
"type": "string"
}
},
"nameservers": {
"type": "array",
"items": {
"title": "Nameservers",
"description": "IPv4 and/or IPv6 are allowed.",
"type": "string",
"additionalProperties": false
"type": "string"
}
},
"wireless": {
Expand Down Expand Up @@ -149,8 +146,7 @@
"type": "array",
"items": {
"title": "A list of the interfaces or connections to be bonded",
"type": "string",
"additionalProperties": false
"type": "string"
}
}
}
Expand All @@ -164,32 +160,28 @@
"type": "array",
"items": {
"title": "A list of kernel command line arguments to match",
"type": "string",
"additionalProperties": false
"type": "string"
}
},
"interface": {
"type": "array",
"items": {
"title": "A list of interface names to match",
"type": "string",
"additionalProperties": false
"type": "string"
}
},
"driver": {
"type": "array",
"items": {
"title": "A list of driver names to match",
"type": "string",
"additionalProperties": false
"type": "string"
}
},
"path": {
"type": "array",
"items": {
"title": "A list of paths to match against the ID_PATH udev property of devices",
"type": "string",
"additionalProperties": false
"type": "string"
}
}
}
Expand Down Expand Up @@ -288,7 +280,7 @@
"items": { "type": "string" }
}
},
"required": ["newLvmVg"]
"required": ["newLvmVg"]
}
]
},
Expand Down Expand Up @@ -329,7 +321,64 @@
},
"space": {
"title": "Policy to find space for the new partitions",
"enum": [ "delete", "resize", "keep" ]
"type": "object",
"additionalProperties": false,
"properties": {
"policy": {
"enum": ["delete", "resize", "keep", "custom"]
},
"actions": {
"type": "array"
}
},
"if": {
"properties": {
"policy": { "const": "custom" }
}
},
"then": {
"required": ["policy", "actions"],
"properties": {
"actions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": ["forceDelete"],
"additionalProperties": false,
"properties": {
"forceDelete": {
"title": "Device to delete",
"type": "string"
}
}
},
{
"type": "object",
"required": ["resize"],
"additionalProperties": false,
"properties": {
"resize": {
"title": "Device to allow resizing",
"type": "string"
}
}
}
]
}
}
}
},
"else": {
"required": ["policy"],
"properties": {
"actions": {
"type": "array",
"maxItems": 0
}
}
}
},
"volumes": {
"title": "Set of volumes (file systems) to create",
Expand All @@ -345,8 +394,8 @@
"required": ["path"],
"properties": {
"path": {
"title": "Mount path",
"type": "string"
"title": "Mount path",
"type": "string"
},
"options": {
"title": "Options to add to the fourth field of fstab",
Expand Down Expand Up @@ -392,19 +441,13 @@
{ "$ref": "#/$defs/sizeString" },
{ "$ref": "#/$defs/sizeInteger" },
{
"description": "Lower size limit and optionally upper size limit",
"type": "array",
"items": {
"$ref": "#/$defs/sizeValue"
},
"minItems": 1,
"maxItems": 2,
"prefixItems": [
{
"title": "Mandatory lower size limit",
"$ref": "#/$defs/sizeValue"
},
{
"title": "Optional upper size limit",
"$ref": "#/$defs/sizeValue"
}
]
"maxItems": 2
},
{
"type": "object",
Expand All @@ -421,23 +464,7 @@
},
"required": ["min"]
}
],
"$defs": {
"sizeString": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?(\\s*([KkMmGgTtPpEeZzYy][iI]?)?[Bb])?"
},
"sizeInteger": {
"type": "integer",
"minimum": 0
},
"sizeValue": {
"oneOf": [
{ "$ref": "#/$defs/sizeString" },
{ "$ref": "#/$defs/sizeInteger" }
]
}
}
]
},
"target": {
"title": "Location of the resulting file system",
Expand Down Expand Up @@ -482,5 +509,21 @@
"title": "Legacy AutoYaST storage settings",
"type": "object"
}
},
"$defs": {
"sizeString": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?(\\s*([KkMmGgTtPpEeZzYy][iI]?)?[Bb])?"
},
"sizeInteger": {
"type": "integer",
"minimum": 0
},
"sizeValue": {
"oneOf": [
{ "$ref": "#/$defs/sizeString" },
{ "$ref": "#/$defs/sizeInteger" }
]
}
}
}

0 comments on commit 6aff4aa

Please sign in to comment.