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
839 stars 45 forks source link

Load all resource versions and sort them #488

Closed jacobtomlinson closed 2 months ago

jacobtomlinson commented 2 months ago

Fixes #482

This PR reads all API versions for each group instead of just reading the latest. This should fix the issue from #482 where a CRD has been dropped from the latest version but you still want to use it.

I've also implemented a version sorting utility so that we can ensure the list of resources is sorted correctly. This means that if you try and create a new class for an object that has multiple versions the latest version will be chosen automatically.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.19%. Comparing base (87063fc) to head (0987ff5). Report is 110 commits behind head on main.

Files with missing lines Patch % Lines
kr8s/_data_utils.py 96.29% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #488 +/- ## ========================================== + Coverage 94.61% 95.19% +0.57% ========================================== Files 29 30 +1 Lines 3141 3973 +832 ========================================== + Hits 2972 3782 +810 - Misses 169 191 +22 ```

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