Browse Source

Skip unscheduled pods when handling NP creation

This is follow up to dce5939c242d44417b74e00382fd0a08a8c34f7b, as
apparently same problem can happen on NP creation. This patch makes sure
we skip unscheduled pods there too.

Change-Id: I20bab73f3adcc12cc103ba82d2f2dfda9841efde
Closes-Bug: 1904040
changes/95/768095/1
Michał Dulko 2 months ago
parent
commit
d650962e84
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      kuryr_kubernetes/controller/handlers/kuryrnetworkpolicy.py

+ 2
- 1
kuryr_kubernetes/controller/handlers/kuryrnetworkpolicy.py View File

@ -197,7 +197,8 @@ class KuryrNetworkPolicyHandler(k8s_base.ResourceEventHandler):
pods_to_update.extend(matched_pods)
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
pod_sgs = self._drv_pod_sg.get_security_groups(pod, project_id)
try:


Loading…
Cancel
Save