Skip to content

Fix: Resolve infinite loading in Map when resource API is unavailable#714

Open
tejhan wants to merge 1 commit into
Azure:headlamp-downstreamfrom
tejhan:fix/hide-gateway-map-filter-when-api-unavailable
Open

Fix: Resolve infinite loading in Map when resource API is unavailable#714
tejhan wants to merge 1 commit into
Azure:headlamp-downstreamfrom
tejhan:fix/hide-gateway-map-filter-when-api-unavailable

Conversation

@tejhan
Copy link
Copy Markdown
Collaborator

@tejhan tejhan commented Jun 3, 2026

Description

This PR resolves an issue where the Map would enter an infinite loading state when a selected resource filter references an API that isn't installed on the cluster (e.g. Gateway API). The useData() hook inmakeKubeSource treated errored requests the same as in-progress ones (null), causing the Map to think the data was still loading forever.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Closes:

Changes Made

  • In makeKubeSource, we check the error returned by useList(). If the request errors (ex 404 for a missing API), return { nodes: [] } instead of null so the Map treats it as loaded with no results rather than still loading. For an inclusive filter, this is expected behavior.

Testing

  1. Connect to a cluster without Gateway API installed.
  2. Open Map.
  3. Check the Gateway (Beta) filter.
  4. Observe the map loads normally (no infinite spinner) — gateway section simply shows no resources.

@tejhan tejhan self-assigned this Jun 3, 2026
Copilot AI review requested due to automatic review settings June 3, 2026 23:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent the Resource Map from entering an infinite loading state when users enable the Gateway (beta) filter on clusters that don’t have the necessary Gateway API CRDs installed, by conditionally hiding that filter based on CRD presence.

Changes:

  • Adds a CRD-based existence check for the gateway.networking.k8s.io API group.
  • Conditionally includes the Gateway (beta) source/filter only when the Gateway API is detected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/resourceMap/sources/definitions/sources.tsx
…is unavailable

Signed-off-by: tejhan-diallo <tejhan.diallo@gmail.com>
@tejhan tejhan force-pushed the fix/hide-gateway-map-filter-when-api-unavailable branch from a4a3ed9 to 4ffd456 Compare June 4, 2026 00:10
@tejhan tejhan changed the title upstreamable: fix: Hide Gateway filter in Map when Gateway API is not… Fix: Resolve infinite loading in Map when resource API is unavailable Jun 4, 2026
@tejhan tejhan requested a review from Copilot June 4, 2026 00:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants