From bb50947391c62e41727db04b393ef7752a7bbc90 Mon Sep 17 00:00:00 2001 From: Malar Invention Date: Sun, 12 Jan 2025 19:41:05 +0530 Subject: [PATCH] fix: log only if updating --- node_external_ip_controller_async.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/node_external_ip_controller_async.py b/node_external_ip_controller_async.py index eb94cd0..adcbcbf 100644 --- a/node_external_ip_controller_async.py +++ b/node_external_ip_controller_async.py @@ -48,10 +48,9 @@ async def update_service_annotation(v1, service, external_ipset): logger.debug( f"Invalid Zlan Gateway IP: {zlan_gateway_ip}, excluding from target annotation" ) - - logger.debug(f"Current annotation: {current_annotation}") - logger.debug(f"Target annotation: {target_annotation}") if annotated_ips != external_ipset: + logger.debug(f"Current annotation: {current_annotation}") + logger.debug(f"Target annotation: {target_annotation}") body = {"metadata": {"annotations": {ANNOTATION_KEY: target_annotation}}} logger.debug(f"Patching service {service_name} with body: {body}") await v1.patch_namespaced_service(service_name, namespace, body)