-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
False
-
-
False
-
-
Summary
The dynamic-plugins.yaml file in the redhat-resource-optimization plugin uses a children structure for hierarchical menu items that does not work with RHDH dynamic plugin loader.
Problem
The dynamic-plugins.yaml (added in commit 9e1f179b / PR #1719) defines the menu structure as:
menuItems: cost-management: text: Cost management icon: costManagementIcon children: openshift: text: OpenShift route: /resource-optimization/openshift optimizations: text: Optimizations route: /resource-optimization
This children structure with nested route properties is not parsed by RHDH dynamic plugin loader. When applied, the menu items do not appear.
Root Cause
The Root.tsx in the static Backstage app uses a custom React component CollapsibleSubmenu to create the hierarchical menu. The dynamic-plugins.yaml was written to mirror this structure conceptually, but RHDH dynamic plugin system uses a different approach.
Working Configuration
RHDH dynamic plugin system requires:
- menuItem inside each dynamicRoute to define the menu text
- menuItems section using parent property to link children UP to parents
- Menu item IDs derived from route paths (e.g., redhat-resource-optimization.ocp for /redhat-resource-optimization/ocp)
- Parent menu items use title not text
dynamicRoutes: - path: /redhat-resource-optimization importName: ResourceOptimizationPage menuItem: icon: costManagementIcon text: Optimizations - path: /redhat-resource-optimization/ocp importName: OpenShiftPage menuItem: icon: costManagementIcon text: OpenShift menuItems: redhat-resource-optimization: parent: cost-management priority: 10 redhat-resource-optimization.ocp: parent: cost-management priority: 20 cost-management: icon: costManagementIcon title: Cost management priority: 100
Impact
Users following the plugin dynamic-plugins.yaml configuration will not see the Cost management menu or its children in RHDH.
Suggested Fix
Update dynamic-plugins.yaml to use the parent property approach that works with RHDH dynamic plugin loader.
- links to