Fix the crd_lb_ip not being defined.

During execution it may happen, that there will be UnboundLocalError
exception thrown for crd_lb_ip variable, due to unmet condition for
service ip not being set in the KuryrLoadbalancerCRD. Fixed by simply
defining variable.

Change-Id: Ie879ba0b9b85111ec1b906d66ec48127ce8dd1f9
This commit is contained in:
Roman Dobosz 2022-05-10 09:32:36 +02:00
parent 962594cc7b
commit 61bfb58898
1 changed files with 1 additions and 0 deletions

View File

@ -594,6 +594,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest):
while time.time() - start < CONF.kuryr_kubernetes.lb_build_timeout:
time.sleep(5)
service = api.read_namespaced_service(service_name, namespace)
crd_lb_ip = None
if service.status.load_balancer.ingress:
try:
klb_crd = cls.get_kuryr_loadbalancer_crds(