Fix CRD update on pod creation
The default value being set when the direction field of the policy is fetched, do not correspond to how the '_parse_rules' function works. This commit fixes the issue by modifying the default value. Closes-bug: 1811809 Change-Id: Ie819f815d38dd9988bd71578bab89579b8fc2ebb
This commit is contained in:
parent
eea37ec162
commit
571079d9cb
|
@ -99,7 +99,7 @@ def _parse_rules(direction, crd, namespace):
|
|||
crd_rules = crd['spec'].get('egressSgRules')
|
||||
|
||||
matched = False
|
||||
rule_list = policy.get(direction, None)
|
||||
rule_list = policy.get(direction, [])
|
||||
for rule_block in rule_list:
|
||||
for rule in rule_block.get(rule_direction, []):
|
||||
pod_selector = rule.get('podSelector')
|
||||
|
|
|
@ -92,7 +92,7 @@ def _parse_rules(direction, crd, pod):
|
|||
crd_rules = crd['spec'].get('egressSgRules')
|
||||
|
||||
matched = False
|
||||
rule_list = policy.get(direction, None)
|
||||
rule_list = policy.get(direction, [])
|
||||
for rule_block in rule_list:
|
||||
for rule in rule_block.get(rule_direction, []):
|
||||
namespace_selector = rule.get('namespaceSelector')
|
||||
|
|
Loading…
Reference in New Issue