fix: if no ip exists set empty set
parent
15ad2e5902
commit
799071601e
|
|
@ -34,8 +34,10 @@ async def update_service_annotation(v1, service, external_ipset):
|
|||
logger.debug(f"Fetching service {service_name} in namespace {namespace}")
|
||||
service_obj = await v1.read_namespaced_service(service_name, namespace)
|
||||
|
||||
current_annotation = service_obj.metadata.annotations.get(ANNOTATION_KEY)
|
||||
annotated_ips = set(current_annotation.split(","))
|
||||
current_annotation = service_obj.metadata.annotations.get(ANNOTATION_KEY, "")
|
||||
annotated_ips = (
|
||||
set(current_annotation.split(",")) if current_annotation else set()
|
||||
)
|
||||
zlan_gateway_ip = service_obj.metadata.labels.get(ZLAN_GATEWAY_IP_KEY)
|
||||
logger.debug(f"Zlan Gateway IP: {zlan_gateway_ip}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue