kr8s-org / kr8s

A batteries-included Python client library for Kubernetes that feels familiar for folks who already know how to use kubectl
https://kr8s.org
BSD 3-Clause "New" or "Revised" License
799 stars 43 forks source link

Make getting resource by name more efficient by using a field selector #452

Closed catdog2 closed 2 weeks ago

catdog2 commented 2 months ago

In case you have a large number of resources getting a resource by name can get very inefficient, esp in terms of memory usage. Currently all resources are retrieved, then filtered for the name on the client side. This behavior is also very surprising for a function taking a single name.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.03%. Comparing base (87063fc) to head (15b1a76). Report is 111 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #452 +/- ## ========================================== + Coverage 94.61% 95.03% +0.41% ========================================== Files 29 30 +1 Lines 3141 3867 +726 ========================================== + Hits 2972 3675 +703 - Misses 169 192 +23 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jacobtomlinson commented 2 weeks ago

There there hasn't been any activity on this issue I'm going to merge it in and open an issue to track the improvements to Api.get().