Fix: Resolve infinite loading in Map when resource API is unavailable#714
Open
tejhan wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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.ioAPI 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.
…is unavailable Signed-off-by: tejhan-diallo <tejhan.diallo@gmail.com>
a4a3ed9 to
4ffd456
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inmakeKubeSourcetreated errored requests the same as in-progress ones (null), causing the Map to think the data was still loading forever.Type of Change
Related Issues
Closes:
Changes Made
makeKubeSource, we check the error returned byuseList(). If the request errors (ex 404 for a missing API), return{ nodes: [] }instead ofnullso the Map treats it as loaded with no results rather than still loading. For an inclusive filter, this is expected behavior.Testing
Gateway (Beta)filter.