appliance: close the v8 gaps for Docker vendor appliances

DockerPropertiesV8 now accepts custom_adapters (already available to
v1-6 top-level appliances and to Qemu v8 properties), so port-named
Docker appliances (XRd, SR Linux) can move to the v8 format without
losing their interface naming.

Appliance.type resolves the node type from the v8 settings template_type
(default set first) instead of misclassifying every v8 appliance as
qemu, and _get_default_symbol applies the docker guest symbol to v8
Docker guest appliances.
This commit is contained in:
YueGuobin committed 2026-08-21 21:41:35 +08:00
1 parent 57fe549773
commit 254721dbda
4 files changed
+149 -1

No files matched your search

+11
View File
@@ -71,6 +71,17 @@ class Appliance:
@property
def type(self):
if self._data.get("registry_version", 0) >= 8:
# registry version 8: the node type comes from the settings template_type,
# the default settings take precedence over the other sets
settings_list = self._data.get("settings") or []
for settings in settings_list:
if settings.get("default"):
return settings.get("template_type", "qemu")
if settings_list:
return settings_list[0].get("template_type", "qemu")
return "qemu"
if "iou" in self._data:
return "iou"
elif "dynamips" in self._data:
+8 -1
View File
@@ -362,7 +362,14 @@ class ApplianceManager:
symbol_theme = controller.symbols.theme
category = appliance["category"]
if category == "guest":
if "docker" in appliance:
if appliance.get("registry_version", 0) >= 8:
# registry version 8: look for a Docker settings set instead of a top-level block
settings_types = [
settings.get("template_type") for settings in appliance.get("settings") or []
]
if "docker" in settings_types:
return controller.symbols.get_default_symbol("docker_guest", symbol_theme)
elif "docker" in appliance:
return controller.symbols.get_default_symbol("docker_guest", symbol_theme)
elif "qemu" in appliance:
return controller.symbols.get_default_symbol("qemu_guest", symbol_theme)