From 7743dfd185f6fd5d7a523053f216c9c1c6aea5d7 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Thu, 14 Nov 2024 18:23:21 -0800 Subject: [PATCH] upd v1 gateway route with validate upstream --- microservices/gatewayApi/v1/routes/gateway.py | 5 ++--- microservices/gatewayApi/v2/routes/gateway.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/microservices/gatewayApi/v1/routes/gateway.py b/microservices/gatewayApi/v1/routes/gateway.py index 2a5932a..ba94ad5 100644 --- a/microservices/gatewayApi/v1/routes/gateway.py +++ b/microservices/gatewayApi/v1/routes/gateway.py @@ -272,9 +272,8 @@ def write_config(namespace: str) -> object: protected_kube_namespaces = json.loads(app.config['protectedKubeNamespaces']) dp = get_data_plane(ns_attributes) - do_validate_upstreams = app.config['data_planes'][dp]["validate-upstreams"] - if do_validate_upstreams is None: - do_validate_upstreams = False + + do_validate_upstreams = app.config['data_planes'][dp].get("validate-upstreams", False) log.debug("Validate upstreams %s %s" % (dp, do_validate_upstreams)) diff --git a/microservices/gatewayApi/v2/routes/gateway.py b/microservices/gatewayApi/v2/routes/gateway.py index 2ed0b40..702216c 100644 --- a/microservices/gatewayApi/v2/routes/gateway.py +++ b/microservices/gatewayApi/v2/routes/gateway.py @@ -268,9 +268,7 @@ def write_config(namespace: str) -> object: try: protected_kube_namespaces = json.loads(app.config['protectedKubeNamespaces']) - do_validate_upstreams = app.config['data_planes'][dp].get("validate-upstreams") - if do_validate_upstreams is None: - do_validate_upstreams = False + do_validate_upstreams = app.config['data_planes'][dp].get("validate-upstreams", False) log.debug("Validate upstreams %s %s" % (dp, do_validate_upstreams)) validate_upstream(gw_config, ns_attributes, protected_kube_namespaces, do_validate_upstreams)