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