Browse Source

Merge "Avoid _get_pods_ips KeyError exception"

Zuul 2 months ago
parent
commit
2f756d9370
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      kuryr_kubernetes/controller/drivers/network_policy.py

+ 1
- 1
kuryr_kubernetes/controller/drivers/network_policy.py View File

@@ -216,7 +216,7 @@ class NetworkPolicyDriver(base.NetworkPolicyDriver):
216 216
         else:
217 217
             matching_pods = driver_utils.get_pods(pod_selector, namespace)
218 218
         for pod in matching_pods.get('items'):
219
-            if pod['status']['podIP']:
219
+            if pod['status'].get('podIP'):
220 220
                 pod_ip = pod['status']['podIP']
221 221
                 ns = pod['metadata']['namespace']
222 222
                 ips.append({'cidr': pod_ip, 'namespace': ns})

Loading…
Cancel
Save