"Watcher failed" error while listing custom resources with multiple versions
Describe the bug
When trying to display list of some types of custom resources as clusters.cluster.x-k8s.io or clusterclasses.cluster.x-k8s.io, the following error message is displayed instead:
Watcher failed for cluster.x-k8s.io/v1alpha3/clusters -- the server could not find the requested resource (get clusters.cluster.x-k8s.io)
Using kubectl CLI, for example kubectl get clusters.cluster.x-k8s.io works without issues.
The error seems to be related to custom resources with multiple .spec.versions used in CRD. I assume that out of the multiple versions, the one with .spec.versions[].served == true and highest in priority order described in https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#version-priority should be returned.
This issue is not present in previous versions as for example v0.31.8.
To Reproduce Steps to reproduce the behavior:
- Go to 'crds'.
- Select CRD item which is known to have multiple
.spec.versionsrecords. - Press Enter to display list of items of given kind.
- See error
Historical Documents Record in k9s.log:
12:33PM DBG No DAO registry entry for "cluster.x-k8s.io/v1alpha3/clusters". Using generics!
12:33PM ERR Watcher failed for cluster.x-k8s.io/v1alpha3/clusters -- the server could not find the requested resource (get clusters.cluster.x-k8s.io) error="the server could not find the requested resource (get clusters.cluster.x-k8s.io)"
Note that in this case, instead of ClusterAPI v1beta1 API version the old v1alpha3 is used.
Expected behavior List of resources is expected to be displayed.
Versions (please complete the following information):
- OS: Ubuntu 22.04 inside WSL2
- K9s: v0.32.5
- K8s: v1.29.6