From: Daan De Meyer Date: Mon, 5 Aug 2024 12:24:41 +0000 (+0200) Subject: Clarify that inherited settings take priority over CLI/main settings X-Git-Tag: v25~368 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a7ab38e81ce27345b73cbc259fed204f6b94d2a;p=thirdparty%2Fmkosi.git Clarify that inherited settings take priority over CLI/main settings If "inherited" settings are configured explicitly in subimages, those values should take priority over values configured in the main config and CLI. --- diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index ab775a1c1..805976fef 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -2515,8 +2515,10 @@ overridden): - `ToolsTreeCertificates=` There are also settings which are passed down to subimages but can -be overridden. Currently the following settings are passed down to -subimages but can be overridden: +be overridden. For these settings, values configured explicitly in +the subimage will take priority over values configured on the CLI or +in the main image config. Currently the following settings are passed +down to subimages but can be overridden: - `ImageId=` - `ImageVersion=` diff --git a/tests/test_config.py b/tests/test_config.py index 4f197caaa..26239716d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -297,6 +297,14 @@ def test_parse_config(tmp_path: Path) -> None: assert one.image_version == "1.2.3" assert two.image_version == "4.5.6" + with chdir(d): + _, [one, two, config] = parse_config(["--image-version", "7.8.9"]) + + # Inherited settings specified on the CLI should not override subimages that configure the setting explicitly. + assert config.image_version == "7.8.9" + assert one.image_version == "7.8.9" + assert two.image_version == "4.5.6" + def test_parse_includes_once(tmp_path: Path) -> None: d = tmp_path