Kevin Veen-Birkenbach
ce029881d0
cmp-rdbms: make vars resilient when database_type is empty
...
Fix a templating crash during docker-compose.yml rendering when a role sets database_type to an empty string or does not expose it (e.g., svc-prx-openresty). Previously _database_id resolved to 'svc-db-' and get_app_conf attempted to read 'docker.services..name', raising AppConfigKeyError: Application ID 'svc-db-' not found.
Changes:
- Introduce _dbtype = (database_type | d('') | trim) and build _database_id only if _dbtype is non-empty.
- Guard central DB lookups: use get_app_conf(..., strict=False, default='') and only when _dbtype is set.
- Default _database_consumer_entity_name to get_entity_name of database_application_id or fallback to application_id.
- Only resolve database_port when _dbtype is set; otherwise empty.
- Minor formatting fixes for env and URL strings.
Impact:
- Prevents failures in roles without a DB or with database_type=''.
- Keeps previous behavior intact for apps with a valid database_type (mariadb/postgres).
- Eliminates 'config_path: docker.services..name' errors while keeping compose templates stable.
https://chatgpt.com/share/689b9d11-6308-800f-b20c-2d9f18d832f1
2025-08-12 21:59:37 +02:00
..
2025-08-12 19:17:02 +02:00
2025-08-12 19:17:02 +02:00
2025-08-11 01:25:31 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 21:59:37 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-05 00:24:31 +03:00
2025-08-08 15:32:26 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:33:28 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:33:28 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:33:28 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:33:28 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 13:15:31 +02:00
2025-08-11 19:33:28 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 04:38:41 +02:00
2025-08-11 19:33:28 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 21:56:34 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 13:15:31 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:33:28 +02:00
2025-07-29 16:35:42 +02:00
2025-08-08 08:39:40 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 04:38:41 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:33:28 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:44:14 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:44:14 +02:00
2025-08-12 13:20:30 +02:00
2025-08-08 17:25:31 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 15:42:26 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-08 15:32:26 +02:00
2025-08-12 15:42:26 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 13:15:31 +02:00
2025-08-12 03:08:33 +02:00
2025-08-08 15:32:26 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-08 15:32:26 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-08 15:32:26 +02:00
2025-08-11 21:48:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 15:00:12 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:33:28 +02:00
2025-08-12 04:38:41 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-08-11 19:44:14 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:33:28 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-07 12:31:20 +02:00
2025-08-07 11:31:06 +02:00
2025-08-12 11:23:56 +02:00
2025-08-11 19:24:08 +02:00
2025-08-07 12:31:20 +02:00
2025-07-29 16:35:42 +02:00
2025-07-29 16:35:42 +02:00
2025-08-11 19:44:14 +02:00
2025-07-29 16:35:42 +02:00
2025-08-12 14:59:00 +02:00
2025-08-07 11:31:06 +02:00
2025-08-11 21:46:29 +02:00
2025-08-12 21:15:33 +02:00
2025-08-07 17:52:34 +02:00
2025-07-29 16:35:42 +02:00
2025-08-07 12:31:20 +02:00
2025-08-07 11:31:06 +02:00
2025-08-08 17:25:31 +02:00
2025-08-07 11:31:06 +02:00
2025-08-11 02:21:02 +02:00
2025-08-10 13:42:52 +02:00
2025-08-08 15:32:26 +02:00
2025-08-12 12:03:53 +02:00
2025-08-11 12:28:31 +02:00
2025-08-12 12:03:53 +02:00
2025-08-08 08:37:12 +02:00
2025-08-12 12:54:27 +02:00
2025-08-12 03:08:33 +02:00
2025-08-07 11:31:06 +02:00
2025-08-12 16:51:24 +02:00
2025-08-12 12:03:53 +02:00
2025-08-11 21:46:29 +02:00
2025-08-12 03:08:33 +02:00
2025-08-08 12:02:14 +02:00
2025-08-11 12:28:31 +02:00
2025-08-08 17:25:31 +02:00
2025-08-11 23:03:24 +02:00
2025-08-12 12:03:53 +02:00
2025-08-12 17:45:19 +02:00
2025-08-08 12:02:14 +02:00
2025-08-08 12:02:14 +02:00
2025-08-07 12:31:20 +02:00
2025-08-11 12:28:31 +02:00
2025-07-29 16:35:42 +02:00
2025-08-08 15:32:26 +02:00
2025-08-08 17:25:31 +02:00
2025-08-07 12:31:20 +02:00
2025-07-29 16:35:42 +02:00
2025-08-08 12:02:14 +02:00
2025-08-07 12:31:20 +02:00
2025-08-07 11:31:06 +02:00
2025-08-11 21:46:29 +02:00
2025-08-07 11:31:06 +02:00
2025-08-07 15:46:56 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-08-07 12:31:20 +02:00
2025-08-12 14:31:24 +02:00
2025-08-12 03:08:33 +02:00
2025-08-12 03:08:33 +02:00
2025-07-29 16:35:42 +02:00
2025-08-08 15:32:26 +02:00
2025-08-08 15:32:26 +02:00
2025-07-04 08:03:27 +02:00
2025-03-20 17:00:07 +01:00
2025-07-24 03:19:16 +02:00
2025-07-10 15:36:40 +02:00
2025-07-12 17:52:36 +02:00
2025-07-29 16:35:42 +02:00