]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Clarify that inherited settings take priority over CLI/main settings
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 5 Aug 2024 12:24:41 +0000 (14:24 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 5 Aug 2024 13:40:21 +0000 (15:40 +0200)
If "inherited" settings are configured explicitly in subimages, those
values should take priority over values configured in the main config
and CLI.

mkosi/resources/mkosi.md
tests/test_config.py

index ab775a1c13c4ba1275d588ca71db0a873e6566da..805976fefaa853a32e88c76729974485c1de2995 100644 (file)
@@ -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=`
index 4f197caaae2dfd8ed58c46ced43cce0b412e3015..26239716d8c473a7ecbc7a0a5741ab515a75bab6 100644 (file)
@@ -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