From: Tj Date: Sat, 10 Feb 2024 16:40:18 +0000 (+0000) Subject: Do not use underscore in image names X-Git-Tag: v21~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd8cda4316ebd80f25d2d54c9fd818c96b91060;p=thirdparty%2Fmkosi.git Do not use underscore in image names 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 --- diff --git a/mkosi/config.py b/mkosi/config.py index 4f9ed5dbb..17fc77908 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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 diff --git a/tests/test_config.py b/tests/test_config.py index a06c0e37f..230dfd198 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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: