Lock in current schema
Accidental schema updates are unintended, so enforce that. Schema updates that don't break API are fine, we can handle that by manually regenerating the schema at such time.
This commit is contained in:
parent
f823a1243f
commit
2c6474f3cb
|
@ -0,0 +1,343 @@
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"version": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 1
|
||||||
|
},
|
||||||
|
"early-commands": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"array"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"reporting": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"error-commands": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"array"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"user-data": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"debconf-selections": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"locale": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"refresh-installer": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"update": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"channel": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"keyboard": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"layout": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"variant": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"toggle": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"layout"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"version": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 2,
|
||||||
|
"maximum": 2
|
||||||
|
},
|
||||||
|
"ethernets": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"match": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"macaddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"driver": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wifis": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"match": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"macaddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"driver": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bridges": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"bonds": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"tunnels": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"vlans": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"version"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"network": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"version": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 2,
|
||||||
|
"maximum": 2
|
||||||
|
},
|
||||||
|
"ethernets": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"match": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"macaddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"driver": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wifis": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"match": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"macaddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"driver": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bridges": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"bonds": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"tunnels": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"vlans": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"version"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"network"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"proxy": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"format": "uri"
|
||||||
|
},
|
||||||
|
"apt": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"preserve_sources_list": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"primary": {
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
"geoip": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"sources": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"storage": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"identity": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"realname": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"hostname": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"username",
|
||||||
|
"hostname",
|
||||||
|
"password"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"ssh": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"install-server": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"authorized-keys": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allow-pw": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"snaps": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"channel": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"classic": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"late-commands": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"array"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"version"
|
||||||
|
],
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
|
@ -2,6 +2,8 @@
|
||||||
set -eux
|
set -eux
|
||||||
python3 -m unittest discover
|
python3 -m unittest discover
|
||||||
|
|
||||||
|
testschema=.subiquity/test-autoinstall-schema.json
|
||||||
|
|
||||||
validate () {
|
validate () {
|
||||||
python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf
|
python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf
|
||||||
if [ ! -e .subiquity/subiquity-client-debug.log ] || [ ! -e .subiquity/subiquity-server-debug.log ]; then
|
if [ ! -e .subiquity/subiquity-client-debug.log ] || [ ! -e .subiquity/subiquity-server-debug.log ]; then
|
||||||
|
@ -18,6 +20,7 @@ validate () {
|
||||||
clean () {
|
clean () {
|
||||||
rm -f .subiquity/subiquity-curtin-install.conf
|
rm -f .subiquity/subiquity-curtin-install.conf
|
||||||
rm -f .subiquity/subiquity-*.log
|
rm -f .subiquity/subiquity-*.log
|
||||||
|
rm -f "$testschema"
|
||||||
rm -rf .subiquity/run/
|
rm -rf .subiquity/run/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,3 +57,6 @@ clean
|
||||||
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall-user-data.yaml \
|
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall-user-data.yaml \
|
||||||
--dry-run --machine-config examples/simple.json --kernel-cmdline 'autoinstall'"
|
--dry-run --machine-config examples/simple.json --kernel-cmdline 'autoinstall'"
|
||||||
validate
|
validate
|
||||||
|
|
||||||
|
python3 -m subiquity.cmd.schema > "$testschema"
|
||||||
|
diff -u "autoinstall-schema.json" "$testschema"
|
||||||
|
|
Loading…
Reference in New Issue