stages(kickstart): add ostreecontainer
Add support for the `ostreecontainer` kickstart command, see: https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#ostreecontainer
This commit is contained in:
parent
36883654ce
commit
20d8d3a9a8
2 changed files with 67 additions and 0 deletions
|
|
@ -122,6 +122,31 @@ SCHEMA = r"""
|
|||
}
|
||||
}
|
||||
},
|
||||
"ostreecontainer": {
|
||||
"type": "object",
|
||||
"required": ["url"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"stateroot": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"transport": {
|
||||
"type": "string",
|
||||
"enum": ["registry", "oci", "oci-archive"],
|
||||
"description": "Use the given transport, Anaconda's default is 'registry'"
|
||||
},
|
||||
"remote": {
|
||||
"type": "string"
|
||||
},
|
||||
"signatureverification": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"liveimg": {
|
||||
"type": "object",
|
||||
"required": ["url"],
|
||||
|
|
@ -514,6 +539,24 @@ def main(tree, options): # pylint: disable=too-many-branches
|
|||
|
||||
config += [cmd]
|
||||
|
||||
ostreecontainer = options.get("ostreecontainer")
|
||||
|
||||
if ostreecontainer:
|
||||
url = ostreecontainer["url"]
|
||||
|
||||
cmd = f"ostreecontainer --url={url}"
|
||||
|
||||
for name in ["stateroot", "transport", "remote"]:
|
||||
value = ostreecontainer.get(name)
|
||||
if value:
|
||||
cmd += f" --{name}={value}"
|
||||
|
||||
signature_verification = ostreecontainer.get("signatureverification", True)
|
||||
if not signature_verification:
|
||||
cmd += " --no-signature-verification"
|
||||
|
||||
config += [cmd]
|
||||
|
||||
liveimg = options.get("liveimg")
|
||||
if liveimg:
|
||||
url = liveimg["url"]
|
||||
|
|
|
|||
|
|
@ -191,6 +191,27 @@ TEST_INPUT = [
|
|||
# hostname can also be written as a QFDN
|
||||
({"network": [{"device": "foo", "hostname": "foo.bar.com"}]},
|
||||
"network --device=foo --hostname=foo.bar.com"),
|
||||
# ostreecontainer
|
||||
(
|
||||
{
|
||||
"ostreecontainer": {
|
||||
"stateroot": "some-osname",
|
||||
"url": "http://some-ostree-url.com/foo",
|
||||
"transport": "registry",
|
||||
"remote": "some-remote",
|
||||
"signatureverification": False,
|
||||
},
|
||||
},
|
||||
"ostreecontainer --url=http://some-ostree-url.com/foo --stateroot=some-osname --transport=registry --remote=some-remote --no-signature-verification",
|
||||
),
|
||||
(
|
||||
{
|
||||
"ostreecontainer": {
|
||||
"url": "http://some-ostree-url.com/foo",
|
||||
},
|
||||
},
|
||||
"ostreecontainer --url=http://some-ostree-url.com/foo",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -318,6 +339,9 @@ def test_kickstart_valid(tmp_path, test_input, expected): # pylint: disable=unu
|
|||
".123456789012345678901234567890123456789012345678901234567890123" +
|
||||
".12345678901234567890123456789012345678901234567890123456789012"
|
||||
}]}, " does not match "),
|
||||
# ostreecontainer
|
||||
({"ostreecontainer": {"url": "http://some-ostree-url.com/foo",
|
||||
"transport": "not-valid"}}, "'not-valid' is not one of ["),
|
||||
],
|
||||
)
|
||||
def test_schema_validation_bad_apples(test_data, expected_err):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue