]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Do not use underscore in image names
authorTj <hacker@iam.tj>
Sat, 10 Feb 2024 16:40:18 +0000 (16:40 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 10 Feb 2024 18:17:22 +0000 (19:17 +0100)
When suffixing image_version (mkosi.version) do not use an underscore
since that breaks systemd-machined/machinectl because undescore are
invalid in machine names.

This is related to commit 7eb4ea8

Closes: #2367
mkosi/config.py
tests/test_config.py

index 4f9ed5dbb30884f9f91db76700d816924a528fe0..17fc77908369c8b333fd714108266c992563511f 100644 (file)
@@ -588,7 +588,7 @@ def config_default_output(namespace: argparse.Namespace) -> str:
     output = namespace.image_id or namespace.image or "image"
 
     if namespace.image_version:
-        output += f"_{namespace.image_version}"
+        output += f"-{namespace.image_version}"
 
     return output
 
index a06c0e37f21a51ede24c859aa2ca3aafd6c6acd4..230dfd1982b984c954a57d9451596f6c50e90edd 100644 (file)
@@ -896,7 +896,7 @@ def test_output_id_version(tmp_path: Path) -> None:
     with chdir(d):
         _, [config] = parse_config()
 
-    assert config.output == "output_1.2.3"
+    assert config.output == "output-1.2.3"
 
 
 def test_deterministic() -> None: