templates: persist appliance metadata on install

Appliance fields that describe the appliance (vendor information, default
credentials, installation instructions...) were dropped when installing a
template. Keep them in a new appliance_metadata JSON column on the
templates table, filled by the appliance-to-template conversion for both
registry v1-6 and v8 (version level values override the appliance level
ones). The nested schema allows extra fields so future registry fields
persist without a migration.
This commit is contained in:
YueGuobin committed 2026-08-21 21:41:42 +08:00
1 parent 1c68a52856
commit 300c53e6fb
7 files changed
+216

No files matched your search

@@ -97,6 +97,10 @@ async def test_install_docker_version_skips_image_resolution(monkeypatch):
assert template["template_type"] == "docker"
# the version image name is injected into the template
assert template["image"] == "xrd:1.0"
# appliance metadata survives the install and validates through TemplateCreate
metadata = template["appliance_metadata"]
assert metadata["vendor_name"] == "Test vendor"
assert metadata["appliance_id"] == appliance.id
@pytest.mark.asyncio