Summary
The GetAllConfigs function in gateway/gateway-controller/pkg/storage/sql_store.go builds a UNION query across all artifact type tables but is missing the webbroker_apis table. This means WebBrokerApi artifacts are saved and retrievable via direct lookup, but are silently omitted from full-list scans and in-memory cache hydration paths.
Impact
Any code path that calls GetAllConfigs (e.g., cache reload on gateway restart) will not return WebBrokerApi configurations, potentially causing stale or incomplete state.
Fix
Add a UNION branch for webbroker_apis in GetAllConfigs, consistent with the existing branches for rest_apis, websub_apis, llm_providers, llm_proxies, and mcp_proxies. Also increment the parameter count passed to s.query.
UNION ALL
+ SELECT a.uuid, a.kind, a.handle, a.display_name, a.version, wb.configuration, a.desired_state,
+ a.deployment_id, a.origin, a.created_at, a.updated_at, a.deployed_at,
+ a.cp_sync_status, a.cp_sync_info, a.cp_artifact_id
+ FROM artifacts a
+ JOIN webbroker_apis wb ON a.uuid = wb.uuid AND a.gateway_id = wb.gateway_id
+ WHERE a.gateway_id = ?
+
+ UNION ALL
SELECT a.uuid, a.kind, a.handle, a.display_name, a.version, lp.configuration, a.desired_state,
And update the query call:
- rows, err := s.query(query, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId)
+ rows, err := s.query(query, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId)
References
Summary
The
GetAllConfigsfunction ingateway/gateway-controller/pkg/storage/sql_store.gobuilds a UNION query across all artifact type tables but is missing thewebbroker_apistable. This meansWebBrokerApiartifacts are saved and retrievable via direct lookup, but are silently omitted from full-list scans and in-memory cache hydration paths.Impact
Any code path that calls
GetAllConfigs(e.g., cache reload on gateway restart) will not returnWebBrokerApiconfigurations, potentially causing stale or incomplete state.Fix
Add a UNION branch for
webbroker_apisinGetAllConfigs, consistent with the existing branches forrest_apis,websub_apis,llm_providers,llm_proxies, andmcp_proxies. Also increment the parameter count passed tos.query.And update the query call:
References