You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is purely a refactoring: moving all Kubernetes-client-related routines into one place.
And a lot of new tests for these K8s-client call (in addition to the existing ones).
Previously, the API calls were spread all over the codebase. And the official Kubernetes client is quite wordy, so the places were also unnecessary wordy (not to their main point).
Few notes:
The peering objects (cluster-scoped, namespace-scoped, and the legacy one) use exactly the same unified logic now, with no exceptions.
There are no changes in the APIs, DSLs, signatures, behaviour or anything user-facing or k8s-facing. Only the internal code moves. Except for this:
When patching AND the object is a cluster-scoped resource (no namespace by design), patch_cluster_custom_object() is used instead of patch_namespaced_custom_object(namespace=None), which would fail. This would also affect the patching of peering objects (cluster-scoped and legacy), but is fixed in place.
Patching of a namespaced resource uses the namespace of the resource itself (even for the cluster-scoped operator).
This PR is also a part of the following chain of changes:
(This PR): Extraction of the K8s-API-related methods to a single place, both for served objects and for peering objects (the logic must be aligned).
(Needed for): Testing of peering logic, regardless of the API calls. Tests automation #13
(Needed for): Testing of how the framework handles the events and which API methods it calls (mocking the central place instead of individual API client calls all around). Tests automation #13
(Needed for): Safe changes of the handling logic (i.e. silent spies, etc). <<< MAIN GOAL.
(Needed for): Switching to pykube-ng (Consider pykube-ng? #15), and generally being K8s-client-agnostic.
(Needed for): Making the whole framework async, eliminating the blocking API calls (or putting them to the asyncio thread executors).
The text was updated successfully, but these errors were encountered:
This is purely a refactoring: moving all Kubernetes-client-related routines into one place.
And a lot of new tests for these K8s-client call (in addition to the existing ones).
Previously, the API calls were spread all over the codebase. And the official Kubernetes client is quite wordy, so the places were also unnecessary wordy (not to their main point).
Few notes:
The peering objects (cluster-scoped, namespace-scoped, and the legacy one) use exactly the same unified logic now, with no exceptions.
There are no changes in the APIs, DSLs, signatures, behaviour or anything user-facing or k8s-facing. Only the internal code moves. Except for this:
patch_cluster_custom_object()
is used instead ofpatch_namespaced_custom_object(namespace=None)
, which would fail. This would also affect the patching of peering objects (cluster-scoped and legacy), but is fixed in place.Patching of a namespaced resource uses the namespace of the resource itself (even for the cluster-scoped operator).
This PR is also a part of the following chain of changes:
The text was updated successfully, but these errors were encountered: