kcp
kcp copied to clipboard
`kubectl explain` is broken for kcp api-resources
Describe the bug
kubectl explain is broken for kcp api-resources, e.g. locations, clusterworkspaces, workspaces et al. Works well for other k8s traditional resources, though, clusterroles.
To Reproduce Steps to reproduce the behavior:
- Login to kcp "stable" service as of this issue is filed
- Show current ws: $ kubectl kcp ws Current workspace is "root:rh-sso-158xxxx". $ kubectl api-resources
NAME SHORTNAMES APIVERSION NAMESPACED KIND
...
clusterroles rbac.authorization.k8s.io/v1 false ClusterRole
...
locations scheduling.kcp.dev/v1alpha1 false Location
clusterworkspaces tenancy.kcp.dev/v1alpha1 false ClusterWorkspace
...
workspaces tenancy.kcp.dev/v1beta1 false Workspace
- Run
kubectl explainfor kcp resources to know the description of them $ kubectl explain locations error: couldn't find resource for "scheduling.kcp.dev/v1alpha1, Kind=Location" Checking if verbose output returns more clues: $ kubectl explain locations --v 6
I0705 16:21:06.184336 9707 loader.go:372] Config loaded from file: /home/xxia/my/env/kcp/kubeconfig
I0705 16:21:08.049208 9707 round_trippers.go:553] GET https://kcp-stable.apps.../clusters/root:rh-sso-158xxxx/openapi/v2?timeout=32s 200 OK in 1864 milliseconds
error: couldn't find resource for "scheduling.kcp.dev/v1alpha1, Kind=Location"
$ kubectl explain clusterworkspaces error: couldn't find resource for "tenancy.kcp.dev/v1alpha1, Kind=ClusterWorkspace" $ kubectl explain workspaces error: couldn't find resource for "tenancy.kcp.dev/v1beta1, Kind=Workspace" Above commands fail to return description for kcp resources. It works well for k8s traditional resources, though, clusterroles: $ kubectl explain clusterroles
KIND: ClusterRole
VERSION: rbac.authorization.k8s.io/v1
DESCRIPTION:
ClusterRole is a cluster level, logical grouping of PolicyRules that can be
Expected behavior
kubectl explain should work well to return description for kcp resources like for k8s traditional resources.
Additional context
This is APIBinding related
Issues go stale after 90d of inactivity.
After a furter 30 days, they will turn rotten.
Mark the issue as fresh with /remove-lifecycle stale.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Is there an plan to work on this? I'm seeing this for exported/bound resources and not just the kcp APIs
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
/lifecycle rotten
/remove-lifecycle rotten
This should work now since #3118 got merged. @gmrodgers sorry for the late reply. Any chance you can give it a spin and confirm please?
This is how it looks like for me on latest main:
$ kubectl explain workspace
GROUP: tenancy.kcp.io
KIND: Workspace
VERSION: v1alpha1
DESCRIPTION:
Workspace defines a generic Kubernetes-cluster-like endpoint, with standard
Kubernetes discovery APIs, OpenAPI and resource API endpoints.
A workspace can be backed by different concrete types of workspace
implementation, depending on access pattern. All workspace implementations
share the characteristic that the URL that serves a given workspace can be
used with standard Kubernetes API machinery and client libraries and command
line tools.
FIELDS:
[...]
The PR mentioned above was included in v0.24.0 and if I didn't misunderstand the issue it should work fine. Closing this.