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
Kopf has grown since the last time the package/module structure was defined. As such, some things do not keep to each other, some upcoming things form different topics.
This PR restructures the layout of internal modules. All public interfaces are kept intact.
Specifically:
kopf.reactor is cleaned up, only the reacting things are left there.
kopf.utilities is created for different runtime-environment-related stuff (e.g. module importing).
kopf.engines is created for all reactor-supporting but not reactor-required activities. Now, it is peering. Soon, it will be k8s-event posting in background & logging to k8s-event (PRs #??? -- add later).
kopf.k8s is renamed to kopf.clients, as (1) the whole framework is anyway about k8s, (2) that package contain the client wrappers/adapters, (3) it can also contain other client adapters, not only k8s.
K8s automatic authentication is moved from kopf.config to kopf.clients.auth, where it belongs (it is an adapter/wrapper for the k8s client library).
Unless users import the internal objects (on their own risk), this should work fine. There are no changes in the logic or behaviour itself, only the structure.
Except for this one:
asyncio tasks creation (create_tasks() internal routine) now requires the loop. Usage of asyncio.Task is officially "discouraged" in the Python docs, so the tasks should be created in the specific loop.
The upcoming changes (few PRs that follow) are built on top of this new structure: e.g. background k8s-event poster is the new "engine", new logging with transparent k8s-event posting is also one of them.
This PR also extracts the complexity from them to make the review easier — as all package moves and cleanups are here.
Types of Changes
Refactor/improvements
The text was updated successfully, but these errors were encountered:
Description
Kopf has grown since the last time the package/module structure was defined. As such, some things do not keep to each other, some upcoming things form different topics.
This PR restructures the layout of internal modules. All public interfaces are kept intact.
Specifically:
kopf.reactor
is cleaned up, only the reacting things are left there.kopf.utilities
is created for different runtime-environment-related stuff (e.g. module importing).kopf.engines
is created for all reactor-supporting but not reactor-required activities. Now, it is peering. Soon, it will be k8s-event posting in background & logging to k8s-event (PRs #??? -- add later).kopf.k8s
is renamed tokopf.clients
, as (1) the whole framework is anyway about k8s, (2) that package contain the client wrappers/adapters, (3) it can also contain other client adapters, not only k8s.kopf.config
tokopf.clients.auth
, where it belongs (it is an adapter/wrapper for the k8s client library).Unless users import the internal objects (on their own risk), this should work fine. There are no changes in the logic or behaviour itself, only the structure.
Except for this one:
create_tasks()
internal routine) now requires the loop. Usage ofasyncio.Task
is officially "discouraged" in the Python docs, so the tasks should be created in the specific loop.The upcoming changes (few PRs that follow) are built on top of this new structure: e.g. background k8s-event poster is the new "engine", new logging with transparent k8s-event posting is also one of them.
This PR also extracts the complexity from them to make the review easier — as all package moves and cleanups are here.
Types of Changes
The text was updated successfully, but these errors were encountered: