Closed jacobtomlinson closed 4 months ago
Attention: Patch coverage is 83.75000%
with 13 lines
in your changes missing coverage. Please review.
Project coverage is 95.00%. Comparing base (
87063fc
) to head (691d306
). Report is 121 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
kr8s/_api.py | 75.00% | 7 Missing :warning: |
kr8s/tests/test_api.py | 76.00% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Closes #199
The goal of this PR is to make
kr8s.get(...)
as flexible askubectl get ...
.For example if I have
Istio
installed I can listGateway
objects in the following ways:With this PR I can now do the following in
kr8s
.Previously I would've had to use
Gateway = kr8s.objects.new_class("gateway", "networking.istio.io/v1")
to register the class before I could get it, but after this PR we look this up automatically if no class can be found but the resource exists on the server.To reinstate the old behaviour we can set the
allow_unknown_type=False
.You can of course still generate the class manually if you want to use things like the default class methods, or you want a type to work with later.