Skip to content

Commit 639b2da

Browse files
committed
Add zync_routes_disabled option
1 parent 5e6b25f commit 639b2da

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

testsuite/capabilities/providers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ def fips():
6868

6969

7070
def zync():
71-
"""Zync is available when the gateway is not ZyncLessApicast"""
71+
"""Zync is available when the gateway is not ZyncLessApicast,
72+
unless zync_routes_disabled is set (zync runs but doesn't create routes)"""
7273
if issubclass(gateways.default, ZyncLessApicast):
73-
return {}
74+
if not weakget(settings)["threescale"]["gateway"]["default"]["zync_routes_disabled"] % False:
75+
return {}
7476
return {Capability.ZYNC}
7577

7678

testsuite/gateways/apicast/zyncless.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from openshift_client import Missing
77
from threescale_api.resources import Service
88

9+
from testsuite.config import settings
910
from testsuite.gateways.apicast.system import SystemApicast
1011
from testsuite.openshift.objects import Routes
1112

@@ -27,9 +28,11 @@ def __init__(self, staging: bool, openshift: "Optional[OpenShiftClient]" = None)
2728
self._routes: "List[str]" = []
2829

2930
def create(self):
30-
enabled = self.openshift.api_manager.get_path("spec/zync/enabled")
31-
if enabled is Missing or enabled:
32-
raise RuntimeError("ZyncLessApicast requires zync to be disabled in the APIManager spec")
31+
zync_routes_disabled = settings["threescale"]["gateway"]["default"].get("zync_routes_disabled", False)
32+
if not zync_routes_disabled:
33+
enabled = self.openshift.api_manager.get_path("spec/zync/enabled")
34+
if enabled is Missing or enabled:
35+
raise RuntimeError("ZyncLessApicast requires zync to be disabled in the APIManager spec")
3336

3437
@staticmethod
3538
def _route_name(service: Service, production: bool = False) -> str:

0 commit comments

Comments
 (0)