Merge "Skip LB sg update when no endpoint is found"

This commit is contained in:
Zuul 2020-05-08 15:57:28 +00:00 committed by Gerrit Code Review
commit 9f98538f36
1 changed files with 6 additions and 1 deletions

View File

@ -790,7 +790,12 @@ class LBaaSv2Driver(base.LBaaSDriver):
endpoints_link = utils.get_endpoints_link(service)
k8s = clients.get_kubernetes_client()
endpoint = k8s.get(endpoints_link)
try:
endpoint = k8s.get(endpoints_link)
except k_exc.K8sResourceNotFound:
LOG.debug("Endpoint not Found. Skipping LB SG update for"
"%s as the LB resources are not present", lbaas_name)
return
lbaas = utils.get_lbaas_state(endpoint)
if not lbaas: