refactor: export applicator singletons from egress_apply backends
test / unit (pull_request) Successful in 35s
test / integration (pull_request) Successful in 21s
lint / lint (push) Successful in 1m44s
test / unit (push) Successful in 32s
test / integration (push) Successful in 19s
Update Quality Badges / update-badges (push) Successful in 1m17s
test / unit (pull_request) Successful in 35s
test / integration (pull_request) Successful in 21s
lint / lint (push) Successful in 1m44s
test / unit (push) Successful in 32s
test / integration (push) Successful in 19s
Update Quality Badges / update-badges (push) Successful in 1m17s
Replace module-level apply_routes_change wrappers with a public applicator singleton in each backend. Callers now work with the EgressApplicator instance directly (applicator.apply_routes_change) rather than through a function shim.
This commit was merged in pull request #248.
This commit is contained in:
@@ -49,20 +49,12 @@ class DockerEgressApplicator(EgressApplicator):
|
||||
)
|
||||
|
||||
|
||||
_applicator = DockerEgressApplicator()
|
||||
|
||||
|
||||
def apply_routes_change(slug: str, content: str) -> tuple[str, str]:
|
||||
return _applicator.apply_routes_change(slug, content)
|
||||
|
||||
|
||||
validate_routes_content = EgressApplicator.validate_routes_content
|
||||
applicator = DockerEgressApplicator()
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DockerEgressApplicator",
|
||||
"EgressApplyError",
|
||||
"apply_routes_change",
|
||||
"applicator",
|
||||
"fetch_current_routes",
|
||||
"validate_routes_content",
|
||||
]
|
||||
|
||||
@@ -33,11 +33,7 @@ class MacOSContainerEgressApplicator(EgressApplicator):
|
||||
)
|
||||
|
||||
|
||||
_applicator = MacOSContainerEgressApplicator()
|
||||
applicator = MacOSContainerEgressApplicator()
|
||||
|
||||
|
||||
def apply_routes_change(slug: str, content: str) -> tuple[str, str]:
|
||||
return _applicator.apply_routes_change(slug, content)
|
||||
|
||||
|
||||
__all__ = ["MacOSContainerEgressApplicator", "EgressApplyError", "apply_routes_change"]
|
||||
__all__ = ["MacOSContainerEgressApplicator", "EgressApplyError", "applicator"]
|
||||
|
||||
@@ -7,15 +7,15 @@ so egress signalling is identical to the docker backend.
|
||||
from __future__ import annotations
|
||||
|
||||
from ..docker.egress_apply import ( # noqa: F401
|
||||
DockerEgressApplicator,
|
||||
EgressApplyError,
|
||||
apply_routes_change,
|
||||
applicator,
|
||||
fetch_current_routes,
|
||||
validate_routes_content,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"DockerEgressApplicator",
|
||||
"EgressApplyError",
|
||||
"apply_routes_change",
|
||||
"applicator",
|
||||
"fetch_current_routes",
|
||||
"validate_routes_content",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user