Use a timeout of 2 seconds when trying to fetch the ingress information for a disconnected Space and attempt to fetch them all in parallel. This should prevent us from hanging forever if a particular kubeconfig context is unreachable or misbehaving. To further help with slow contexts, avoid the overhead of controller-runtime's REST mapping by using the typed client-go client to fetch the ingress ConfigMap.
To make the UI feel more responsive when requests are slow, update the item list asynchronously to the main update loop of the TUI and trigger an update once we have our items. This lets us run a spinner while the items are being updated. As part of this change, switch from generating our own title to using the list widget's built-in title bar, which doesn't change how the TUI looks at all, but lets us leverage the built-in spinner capability of the list widget.
Description of your changes
Use a timeout of 2 seconds when trying to fetch the ingress information for a disconnected Space and attempt to fetch them all in parallel. This should prevent us from hanging forever if a particular kubeconfig context is unreachable or misbehaving. To further help with slow contexts, avoid the overhead of controller-runtime's REST mapping by using the typed client-go client to fetch the ingress ConfigMap.
To make the UI feel more responsive when requests are slow, update the item list asynchronously to the main update loop of the TUI and trigger an update once we have our items. This lets us run a spinner while the items are being updated. As part of this change, switch from generating our own title to using the list widget's built-in title bar, which doesn't change how the TUI looks at all, but lets us leverage the built-in spinner capability of the list widget.
Fixes #549
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
To test the handling of slow or broken contexts, I did the following:
localhost:65432
, which doesn't have any cluster listening on it.nc -kl 65432
to simulate a server accepting requests but not responding.This lets me observe the new timeout, which I verified we're hitting by adding some temporary debug logging.
Also tested navigating through the tree and selecting contexts as normal to ensure the spinner change didn't break anything.