Merge "Fix SG rule creation when Pod is created after NP"

This commit is contained in:
Zuul 2019-05-20 08:00:47 +00:00 committed by Gerrit Code Review
commit df31c6075a
1 changed files with 5 additions and 0 deletions

View File

@ -497,6 +497,11 @@ class NetworkPolicyDriver(base.NetworkPolicyDriver):
elif allowed_resources or allow_all or selectors:
for resource in allowed_resources:
cidr, namespace = self._get_resource_details(resource)
# NOTE(maysams): Skipping resource that do not have
# an IP assigned. The security group rule creation
# will be triggered again after the resource is running.
if not cidr:
continue
rule = driver_utils.create_security_group_rule_body(
sg_id, direction,
port_range_min=1,