Merge "Skip unscheduled pods when handling NP creation"

This commit is contained in:
Zuul 2021-01-07 11:43:51 +00:00 committed by Gerrit Code Review
commit d4c6bbb4ba
1 changed files with 2 additions and 1 deletions

View File

@ -197,7 +197,8 @@ class KuryrNetworkPolicyHandler(k8s_base.ResourceEventHandler):
pods_to_update.extend(matched_pods) pods_to_update.extend(matched_pods)
for pod in pods_to_update: for pod in pods_to_update:
if driver_utils.is_host_network(pod): if (driver_utils.is_host_network(pod) or
not driver_utils.is_pod_scheduled(pod)):
continue continue
pod_sgs = self._drv_pod_sg.get_security_groups(pod, project_id) pod_sgs = self._drv_pod_sg.get_security_groups(pod, project_id)
try: try: