From c00dedc2b99a87e96616f5a043dea57c8f566e68 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Tue, 23 Jul 2024 14:13:06 +0200 Subject: [PATCH] fix(operator): handle tls disable/enable --- library/pingdom.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/library/pingdom.py b/library/pingdom.py index 9b68de5..8908eb2 100644 --- a/library/pingdom.py +++ b/library/pingdom.py @@ -382,12 +382,18 @@ def modify_check(self, checkid: int, ingress): } logging.debug("Processing checkid: {}".format(checkid)) + port = 80 if ingress.https: - value = ingress.https - if check_body['type'][type]['encryption'] != value: - logging.info( - " {}: {} -> {}".format('encryption', check_body['type'], value)) - check_modify_request['encryption'] = value + port = 443 + + encryption = ingress.https + if check_body['type'][type]['encryption'] != encryption: + logging.info( + " {}: {} -> {}".format('encryption', check_body['type'], encryption)) + check_modify_request['encryption'] = encryption + + if check_body['type'][type]['port'] != port: + check_modify_request['port'] = port if ingress.hosts: value = ingress.hosts[0]