Don't crash on fetching network policy.

Sometimes, on pod deletion it happens that kuryr network policy CRD
cannot be found anymore, but we get error from K8s API. Let's wait for
API is functional again.

Change-Id: I24255e59fac46ac10ca815b50d6060c395b4bf34
This commit is contained in:
Roman Dobosz 2020-09-28 09:45:49 +02:00
parent 28a0a99b5e
commit ab374e5dfb
1 changed files with 2 additions and 2 deletions

View File

@ -319,8 +319,8 @@ def get_kuryrnetworkpolicy_crds(namespace=None):
LOG.exception("KuryrNetworkPolicy CRD not found") LOG.exception("KuryrNetworkPolicy CRD not found")
return [] return []
except k_exc.K8sClientException: except k_exc.K8sClientException:
LOG.exception("Kubernetes Client Exception") LOG.exception("Exception during fetch KuryrNetworkPolicies. Retrying.")
raise raise k_exc.ResourceNotReady(knp_path)
return knps.get('items', []) return knps.get('items', [])