Skip to content

Commit

Permalink
Fixed EDGE failure if the endpoint contains an invalid json
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoruka committed Aug 3, 2023
1 parent 85c3d6f commit 4bf930d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deploy/docker/cp-edge/sync-routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,12 @@ def get_service_list(active_runs_list, pod_id, pod_run_id, pod_ip):
if endpoints_data:
endpoints_count = len(endpoints_data)
for i in range(endpoints_count):
endpoint = json.loads(endpoints_data[i])
endpoint = None
try:
endpoint = json.loads(endpoints_data[i])
except Exception as endpoint_parse_exception:
do_log('Parsing endpoint #{} failed:\n{}'.format(str(i), str(endpoint_parse_exception)))
continue
if endpoint["nginx"]:
port = endpoint["nginx"]["port"]
path = endpoint["nginx"].get("path", "")
Expand Down

0 comments on commit 4bf930d

Please sign in to comment.