k9s icon indicating copy to clipboard operation
k9s copied to clipboard

"Watcher failed" error while listing custom resources with multiple versions

Open kukacz opened this issue 1 year ago • 0 comments




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:

  1. Go to 'crds'.
  2. Select CRD item which is known to have multiple .spec.versions records.
  3. Press Enter to display list of items of given kind.
  4. 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

kukacz avatar Aug 20 '24 10:08 kukacz