-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list_namespaced_custom_object() enforces namespace, does not allow listing across namespaces #1750
Comments
kubectl supports listing across all the namespaces but I'm not sure if it's implemented client-side or server-side. Could you check what API kubectl calls by running |
It is implemented server-side. Namespced custom resources offer the
|
Thanks @f4z3r! Agree we need a method for the API. This can be fixed in the openapi spec we use to generate the custom_object API. Would a On a side note, we have a method calling that API already (list_cluster_custom_object), but the naming can be confusing. |
Yes, such a method would be fine. I guess it depends whether you want to make a distinction between namespaced and cluster level custom objects. I realize that in terms of the python client there is little difference, but logically they are treated very differently by Kubernetes. If such a distinction is desired, I would name the method If the distinction is not desired, then I guess the existing method for cluster level custom objects would do the trick, but yes, the naming is very confusing. I would then rename it to simply |
I like that, and I'd love to express that in our openapi spec. However reading apigee-127/sway#32 it seems impossible to achieve in openapi. Agree there are two approaches, using one method for both cases v.s. having two methods. As you pointed out changing the name of the existing method is backwards-incompatible. I think we can have a patch to add a second method |
I have run into this issue, was wondering if there is any progress on this? As I need to read clusterwide CustomResources. |
Hi, I have not worked on this as it requires a change in the OpenAPI spec that I am unfamiliar with. I could, at best, have a look in a week or two. Depends on how much other work I have. You can however currently "misuse" the |
I think what you are asking for is implemented in #1377 |
Hello @f4z3r , |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What is the feature and why do you need it:
When listing namespaced custom resources via
list_namespaced_custom_object
, a namespace needs to be provided. However the Kubernetes API provides an endpoint to list resources across namespaces, useful for performing label selection across the entire cluster.Describe the solution you'd like to see:
Make the
namespace
argument to the function optional, like in all other functions that perform "list" operations on the cluster. When not provided, the call goes to/apis/<domain>/<version>/<crd>
instead of/apis/<domain>/<version>/namespaces/<ns>/<crd>
.The text was updated successfully, but these errors were encountered: