fix: return backend/workspace key instead of internal UUID in resolved Runtime Blueprint

runtime_blueprint.backend_id/workspace_id must be the stable, distro-neutral
key (e.g. "fedora") as documented in 08-provisioning-api.md, not the
internal database UUID - the installer's backend dispatch
(backends/${backend_id}/backend.sh) depends on it being a directory-safe
key.
This commit is contained in:
Thomas Stallinger 2026-07-18 10:48:50 +02:00
parent 11186dfdf9
commit e02b646564

18
app.py
View File

@ -382,9 +382,12 @@ def resolve_template(template_id: str, payload: ResolveRequest):
with conn.cursor() as cur:
cur.execute(
"""
SELECT workspace_id, backend_id, disk_encryption, partitioning, secure_boot_required
FROM bereitstellungsvorlagen
WHERE id = %s
SELECT bv.workspace_id, bv.backend_id, w.key, b.key,
bv.disk_encryption, bv.partitioning, bv.secure_boot_required
FROM bereitstellungsvorlagen bv
JOIN workspaces w ON w.id = bv.workspace_id
JOIN backends b ON b.id = bv.backend_id
WHERE bv.id = %s
""",
(template_id,),
)
@ -397,7 +400,10 @@ def resolve_template(template_id: str, payload: ResolveRequest):
"message": "Die angeforderte Bereitstellungsvorlage wurde nicht gefunden."
}
workspace_id, backend_id, disk_encryption, partitioning, secure_boot_required = template_row
(
workspace_id, backend_id, workspace_key, backend_key,
disk_encryption, partitioning, secure_boot_required,
) = template_row
cur.execute(
"""
@ -427,8 +433,8 @@ def resolve_template(template_id: str, payload: ResolveRequest):
return {
"success": True,
"runtime_blueprint": {
"workspace_id": str(workspace_id),
"backend_id": str(backend_id),
"workspace_id": workspace_key,
"backend_id": backend_key,
"blueprints": blueprints,
"installation_directives": {
"disk_encryption": disk_encryption,