summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaysa Macedo <maysa.macedo95@gmail.com>2019-01-04 12:59:46 +0000
committerMaysa Macedo <maysa.macedo95@gmail.com>2019-01-04 12:59:46 +0000
commit602ecfae28dde15f8a9cab29f7938223fa9a8b61 (patch)
treefe6162f1203926529e3d0fa66b204eda7b79286b
parent71a8ebd1f047efcd11210bceec886e4984a409a8 (diff)
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
Notes
Notes (review): Code-Review+2: Daniel Mellado <dmellado@redhat.com> Code-Review+2: Luis Tomas Bolivar <ltomasbo@redhat.com> Workflow+1: Luis Tomas Bolivar <ltomasbo@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 04 Jan 2019 17:51:57 +0000 Reviewed-on: https://review.openstack.org/628436 Project: openstack/kuryr-kubernetes Branch: refs/heads/master
-rw-r--r--kuryr_kubernetes/controller/drivers/network_policy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/kuryr_kubernetes/controller/drivers/network_policy.py b/kuryr_kubernetes/controller/drivers/network_policy.py
index 8016257..d49db44 100644
--- a/kuryr_kubernetes/controller/drivers/network_policy.py
+++ b/kuryr_kubernetes/controller/drivers/network_policy.py
@@ -177,7 +177,7 @@ class NetworkPolicyDriver(base.NetworkPolicyDriver):
177 def _get_pods_ips(self, pod_selector, namespace=None, 177 def _get_pods_ips(self, pod_selector, namespace=None,
178 namespace_selector=None): 178 namespace_selector=None):
179 ips = [] 179 ips = []
180 matching_pods = [] 180 matching_pods = {"items": []}
181 if namespace_selector: 181 if namespace_selector:
182 matching_namespaces = utils.get_namespaces(namespace_selector) 182 matching_namespaces = utils.get_namespaces(namespace_selector)
183 for ns in matching_namespaces.get('items'): 183 for ns in matching_namespaces.get('items'):