Ability (button) to force update the list of objects, which were deleted but still showing in Lens
What would you like to be added: Button to update the list of current objects in K8s. Or some kind of configurable interval for periodic updates.
Why is this needed: Sometimes, after deleting/terminating objects they are still exist in Lens (looks like a cache) and they are not disappear until you disconnect/connect to the cluster. Switching to the Overview or other tabs also doesn't help.
Environment you are Lens application on:
- Kubernetes distribution: EKS 1.19
- Desktop OS: MacOS Catalina 10.15.7
- Current Lens version: 4.1.4
Related to #1126.
Yes I guess we technically have a cache, but it is more of a representation of what Lens views the cluster's state is. We use watch apis so logs in DEBUG mode could be useful to triage this.
Do the resources change state at all? If not then maybe Lens is dropping some of the events.
Hey @Nokel81 , thanks for response.
What is the behavior of watch if the resource was deleted?
For example I've deleted some CRD's with kubectl delete -f crds.yaml.
(The same was for services, ingresses, etc)
Should Lens reload the data in tab periodically?
@Nokel81 , got an example:
PV was deleted, but still show in Lens. Additionally I can open the details, but resource already doesn't exist, which no make sense.
I would expect something like icon: ⚠️ with notification that it was deleted and will disappear in few minutes/seconds.
Thanks for the screenshot. Iirc the delete events should™ be passed back during a watch. So something else seems to be happening.
Okay so I have done some digging and Lens does get the same info that kubectl get pv -o=json returns. However, for the case of persistent volumes Kube does not change the status when a pv has been told been deleted but it still is active (namely what kubectl displays as "terminating"). So Lens should handle this case when the deletionTimestamp is set on the returned value's metadata object.
Though once I cleared the pv's protection finalizer Lens did clear it immediately.
I haven't been using Lens for long but I keep having this issue. It's a custom resource which has been deleted but still appears in the list in Lens. Attempting to delete it via the Lens UI shows a not found error.
Switching to a different kind or namespace and then back doesn't cause a refresh - The only solution I've found is to close Lens and open it again. :(
Still valid for Lens: 2025.8.121212-latest so many years after the report.