fix(deploy): allow repeatable typed core releases

This commit is contained in:
Codex
2026-08-13 09:44:07 +03:00
parent 71fff82c99
commit 9c359111ea
3 changed files with 186 additions and 6 deletions
+19 -4
View File
@@ -12874,7 +12874,12 @@ def validate_device_plane_control_core_release_predecessor(payload_dir):
):
die("Device Control Core release predecessor journal mismatch")
installed_release = DEVICE_PLANE_ROOT / DEVICE_PLANE_CONTROL_CORE_RELEASE_REL
installed_v1_release = (
DEVICE_PLANE_ROOT / DEVICE_PLANE_CONTROL_CORE_RELEASE_REL
)
installed_v2_release = (
DEVICE_PLANE_ROOT / DEVICE_PLANE_CONTROL_CORE_RELEASE_V2_REL
)
with tempfile.TemporaryDirectory(
prefix="device-control-core-release-predecessor-",
dir=TMP_DIR,
@@ -12903,10 +12908,21 @@ def validate_device_plane_control_core_release_predecessor(payload_dir):
DEVICE_PLANE_EDGE_CORE_CHANNEL_UPGRADE_V4_REL,
)
)
if installed_release.exists() or installed_release.is_symlink():
if (
installed_v1_release.exists()
or installed_v1_release.is_symlink()
or installed_v2_release.exists()
or installed_v2_release.is_symlink()
):
die("Device Control Core first release is already installed")
else:
if tuple(entries) != DEVICE_PLANE_CONTROL_CORE_RELEASE_ENTRIES:
if tuple(entries) == DEVICE_PLANE_CONTROL_CORE_RELEASE_ENTRIES:
installed_release = installed_v1_release
source_entries = DEVICE_PLANE_CONTROL_CORE_RELEASE_ENTRIES
elif tuple(entries) == DEVICE_PLANE_CONTROL_CORE_RELEASE_V2_ENTRIES:
installed_release = installed_v2_release
source_entries = DEVICE_PLANE_CONTROL_CORE_RELEASE_V2_ENTRIES
else:
die("Device Control Core release predecessor type mismatch")
expected_installed = validate_device_plane_control_core_release_payload(
predecessor_payload,
@@ -12919,7 +12935,6 @@ def validate_device_plane_control_core_release_predecessor(payload_dir):
)
if installed_descriptor != expected_installed:
die("Device Control Core release predecessor is not current")
source_entries = DEVICE_PLANE_CONTROL_CORE_RELEASE_ENTRIES
expected_source = collect_exact_files(
predecessor_payload,
source_entries,