Chore: Refactor kubernetes tests to use canonical test infrastructure
We have quite some kubernetes (unit) tests, where we hook into the http layer. This is blocking the bump of various k8s modules, as e.g. k8s.io/client-go v0.32 changes the codec and other bits.
Rather than adapting the tests on how we hook into the http layer, we should use the upstream / canonical test infrastructure like:
We have some tests leveraging this already.
This will
- decouple us from the inner workings of the k8s client
- unblocks bumping of the client-go
Notes:
- We mostly want to remove usage of helpers like
testKubernetesClient
,testVersionAndCodec
, fake client roundtrippers and related functions/mechanisms -- we rather want to rely on the above mentioned upstream test infra components. - There are some aspects which the upstream testing infra does not handle very well (example). If we run into any of those, we should see if we can guard against that on a different layer, e.g. via integration tests.
This issue is the result of this discussion
Edited by Hannes Hörl