From 884e4e1237afdc1164efc91675c345f71a60c29e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Nov 2023 12:12:17 +0100 Subject: [PATCH] stages(kickstart): do not allow extra options under clearpart Fix an oversight from https://github.com/osbuild/osbuild/pull/1426 --- stages/org.osbuild.kickstart | 1 + stages/test/test_kickstart.py | 1 + 2 files changed, 2 insertions(+) diff --git a/stages/org.osbuild.kickstart b/stages/org.osbuild.kickstart index 82f949c173..5dc9b42eeb 100755 --- a/stages/org.osbuild.kickstart +++ b/stages/org.osbuild.kickstart @@ -139,6 +139,7 @@ SCHEMA = r""" "clearpart": { "description": "Removes partitions from the system, prior to creation of new partitions", "type": "object", + "additionalProperties": false, "properties": { "all": { "description": "Erases all partitions from the system", diff --git a/stages/test/test_kickstart.py b/stages/test/test_kickstart.py index 1bd64ace68..b87d82f274 100644 --- a/stages/test/test_kickstart.py +++ b/stages/test/test_kickstart.py @@ -118,6 +118,7 @@ def test_kickstart(tmp_path, test_input, expected): ({"clearpart": {"list": ["\n%pre not allowed"]}}, "not allowed' does not match"), ({"clearpart": {"list": ["no,comma"]}}, "no,comma' does not match"), ({"clearpart": {"disklabel": "\n%pre not allowed"}}, "not allowed' does not match"), + ({"clearpart": {"random": "option"}}, "Additional properties are not allowed"), # GOOD pattern we want to keep working ({"clearpart": {"drives": ["sd*|hd*|vda", "/dev/vdc"]}}, ""), ({"clearpart": {"drives": ["disk/by-id/scsi-58095BEC5510947BE8C0360F604351918"]}}, ""),