Repository navigation
fix: route cluster data through backend when local agent is suppressed - #24445
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!
This is an automated message. |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88 |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
…yload (#24457) #24445 routes cluster data through the backend when no_local_agent is set, so /api/mcp/clusters/<name>/health is now requested. The Clusters/Dashboard e2e mocks matched it as the cluster list, zeroing healthy/node counts in webkit/firefox nightly. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #24438
Root cause
Live
/deploymentsshowsError loading deployment data — All cluster fetches failed, sodata-live-route-stateisunavailable.assertLiveRouteStateLoadedcorrectly flags that state.Evidence from run 39183415566 (
console-live-promote-evidencetrace.zip):/healthon console-live returnsin_cluster: false,no_local_agent: true, andinstall_method: "binary". The backend uses a kubeconfig that covers 3 CI clusters; it does not use an in-cluster ServiceAccount.isInClusterMode()is false andisClusterModeBackend()is false. Because the local agent is suppressed,LOCAL_AGENT_HTTP_URL === ''.useCachedDeployments→fetchViaSSE/fetchFromAllClusters→fetchAPIthen requests relative SPA routes:GET /deployments?cluster=ks-console-ci-{1,2,3}→200 text/html(index.html). Parsing fails as non-JSON, every cluster fails, and the result isAll cluster fetches failed./api/mcp/deploymentsor/api/mcp/deployments/stream, although the backend serves both.Fix
isClusterModeBackend()now also returns true whenisLocalAgentSuppressed()is set. With no local agent, the Go backend (/api/mcp/*) is the only valid data source. Previously, the agent-routed REST path could only fetch SPA HTML.getClusterFetcher,fetchFromAllClusters,fetchViaSSEandfetchClustersnow go through the backend in this configuration, which matches the existing in-cluster behaviour.I added unit tests in
fetcherUtils-coverage.test.ts. I did not run any tests locally; CI will validate.— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88