Closed benedikt-bartscher closed 9 months ago
This many calls is definitely not intended. We look up all of the API resources so that we can expand shortnames in calls like kr8s.get("po")
. I think there are two separate things here we might want to fix:
APIObject.get()
shouldn't look up short names at allkubectl get
does this to reduce the number of calls)I've just merged #252 which fixes this specific problem.
>>> import logging
>>> from kr8s.objects import Pod
>>> logging.basicConfig(level=logging.INFO)
>>> Pod.get("test-pod")
INFO:httpx:HTTP Request: GET https://127.0.0.1:43613/api/v1/namespaces/foo/pods "HTTP/1.1 200 OK"
<Pod test-pod>
I've also raised #253 to track caching these requests better in situations where we do actually want to call them.
Which project are you reporting a bug for?
kr8s
What happened?
Every get call with kr8s seems to fetch all crd endpoints once. Even if i use the
Secret
object directly. Is this intended behaviour?Anything else?
No response