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
This commit is contained in:
Maysa Macedo 2019-01-04 12:59:46 +00:00
parent 71a8ebd1f0
commit 602ecfae28
1 changed files with 1 additions and 1 deletions

View File

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