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:
parent
71a8ebd1f0
commit
602ecfae28
|
@ -177,7 +177,7 @@ class NetworkPolicyDriver(base.NetworkPolicyDriver):
|
||||||
def _get_pods_ips(self, pod_selector, namespace=None,
|
def _get_pods_ips(self, pod_selector, namespace=None,
|
||||||
namespace_selector=None):
|
namespace_selector=None):
|
||||||
ips = []
|
ips = []
|
||||||
matching_pods = []
|
matching_pods = {"items": []}
|
||||||
if namespace_selector:
|
if namespace_selector:
|
||||||
matching_namespaces = utils.get_namespaces(namespace_selector)
|
matching_namespaces = utils.get_namespaces(namespace_selector)
|
||||||
for ns in matching_namespaces.get('items'):
|
for ns in matching_namespaces.get('items'):
|
||||||
|
|
Loading…
Reference in New Issue