Browse Source

Fix NP creation when it has namespaceSelector

The default result for the operation of getting matched pods does not
matches how the function of getting pods ips works. This commit fixes
the issue by modifing the default value.

Closes-Bug: 1810442
Partially Implements: blueprint k8s-network-policies

Change-Id: I07f72b85b81f02cfdf22d7e7df0afa3988fa10af
tags/0.6.1
Maysa Macedo 5 months ago
parent
commit
602ecfae28
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

@@ -177,7 +177,7 @@ class NetworkPolicyDriver(base.NetworkPolicyDriver):
177 177
     def _get_pods_ips(self, pod_selector, namespace=None,
178 178
                       namespace_selector=None):
179 179
         ips = []
180
-        matching_pods = []
180
+        matching_pods = {"items": []}
181 181
         if namespace_selector:
182 182
             matching_namespaces = utils.get_namespaces(namespace_selector)
183 183
             for ns in matching_namespaces.get('items'):

Loading…
Cancel
Save