The GRPCRouteDetails component uses the section ID headlamp.httproute-parentrefs instead of headlamp.grpcroute-parentrefs. This appears to be a copy-paste error from HTTPRouteDetails, which uses the same ID for its own parent refs section.
This causes both components to register their extraSections under the same ID, which can lead to:
- Section identification conflicts in the
DetailsGrid
- Issues with plugins that target sections by their unique ID
File: frontend/src/components/gateway/GRPCRouteDetails.tsx (Line 35)
// Current (incorrect):
id: 'headlamp.httproute-parentrefs',
// Expected:
id: 'headlamp.grpcroute-parentrefs',
For reference, the same ID is correctly used in HTTPRouteDetails.tsx:
https://github.com/headlamp-k8s/headlamp/blob/main/frontend/src/components/gateway/HTTPRouteDetails.tsx#L231
To Reproduce
- Navigate to frontend/src/components/gateway/GRPCRouteDetails.tsx
- Observe line 35: the section ID is
headlamp.httproute-parentrefs
- Compare with HTTPRouteDetails.tsx line 231: the same ID is used there
- Both components register a section with the identical ID, which is incorrect for GRPCRouteDetails
Environment
- Installation type: Source (reviewing codebase on
main branch)
- Headlamp Version: latest
main
Are you able to fix this issue?
Yes, I will propose a PR with the fix.
Additional Context
I also noticed several leftover console.log debug statements in production code while reviewing the codebase. I plan to include their cleanup in the same PR:
| File |
Issue |
clusterRequests.ts:328 |
console.log(url, requestOptions) in remove() — logs every DELETE API request |
HTTPRouteDetails.tsx:154 |
console.log(namespace, backendRefs) in RuleBackendRefs |
NewProjectPopup.tsx:305 |
console.log({ newValue }) in onChange handler |
portforward/index.tsx:350 |
console.log used instead of console.error for error |
useSidebarItems.tsx:68 |
console.log used instead of console.error for CRD fetch error |
The GRPCRouteDetails component uses the section ID
headlamp.httproute-parentrefsinstead ofheadlamp.grpcroute-parentrefs. This appears to be a copy-paste error from HTTPRouteDetails, which uses the same ID for its own parent refs section.This causes both components to register their
extraSectionsunder the same ID, which can lead to:DetailsGridFile:
frontend/src/components/gateway/GRPCRouteDetails.tsx(Line 35)For reference, the same ID is correctly used in HTTPRouteDetails.tsx:
https://github.com/headlamp-k8s/headlamp/blob/main/frontend/src/components/gateway/HTTPRouteDetails.tsx#L231
To Reproduce
headlamp.httproute-parentrefsEnvironment
mainbranch)mainAre you able to fix this issue?
Yes, I will propose a PR with the fix.
Additional Context
I also noticed several leftover
console.logdebug statements in production code while reviewing the codebase. I plan to include their cleanup in the same PR:clusterRequests.ts:328console.log(url, requestOptions)in remove() — logs every DELETE API requestHTTPRouteDetails.tsx:154console.log(namespace, backendRefs)in RuleBackendRefsNewProjectPopup.tsx:305console.log({ newValue })in onChange handlerportforward/index.tsx:350console.logused instead ofconsole.errorfor erroruseSidebarItems.tsx:68console.logused instead ofconsole.errorfor CRD fetch error