fix ST's to add implied 'types': [ingress/egress]
Wherever a policy has both ingress and egress rules,
libcalico-go now adds the implied 'types' field with
both ingress and egress. Update ST's to make this
addition explicit (otherwise 7 STs fail since the
actual datastore policy differs from the written version.)
@@ -163,7 +163,9 @@ class TestCreateFromFile(TestBase):
"type=='application'",
'tag': 'footag'}}],
'order': 100,
- 'selector': "type=='database'"}}),
+ 'selector': "type=='database'",
+ 'types': ['ingress', 'egress']}
+ }),
("policy2", {'apiVersion': 'v1',
'kind': 'policy',
'metadata': {'name': 'policy2'},
@@ -177,7 +179,9 @@ class TestCreateFromFile(TestBase):
'source': {}}],
'order': 100000,
'selector': "",
- 'doNotTrack': True}}),
+ 'doNotTrack': True,
+ 'types': ['ingress', 'egress']}
+ }),
("pool1", {'apiVersion': 'v1',
'kind': 'ipPool',
'metadata': {'cidr': "10.0.1.0/24"},
@@ -406,7 +410,8 @@ class TestCreateFromFile(TestBase):
'selector': "type=='application'",
'tag': 'footag'}}],
'order': 100,
- 'selector': "type=='database'"}},
+ 'selector': "type=='database'",
+ 'types': ['ingress', 'egress']}},
{'apiVersion': 'v1',
'kind': 'policy',
'metadata': {'name': 'policy2',
@@ -421,7 +426,8 @@ class TestCreateFromFile(TestBase):
'protocol': 'udp',
'source': {}}],
'order': 100000,
- 'selector': ""}},
+ 'selector': "",
+ 'types': ['ingress', 'egress']}},
),
("ipPool",
{'apiVersion': 'v1',
@@ -578,7 +584,8 @@ class TestCreateFromFile(TestBase):
'ports': [1, 2, 3, 4],
'tag': 'web'}}],
'order': 6543215.5,
- 'selector': ''}},
+ 'selector': '',
+ 'types': ['ingress', 'egress']}},
{'apiVersion': 'v1',
'kind': 'policy',
'metadata': {'name': 'policy1'},
@@ -601,7 +608,8 @@ class TestCreateFromFile(TestBase):
'ports': [1, 2, 3, 4],
'tag': 'web'}}],
'order': 100000,
- 'selector': ""}},
+ 'selector': "",
+ 'types': ['ingress', 'egress']}},
),
# https://github.com/projectcalico/libcalico-go/issues/230
("policy",
@@ -627,7 +635,8 @@ class TestCreateFromFile(TestBase):
'ports': [1, 2, 3, 4],
'tag': 'web'}}],
'order': 6543215.321,
- 'selector': ''}},
+ 'selector': '',
+ 'types': ['ingress', 'egress']}},
{'apiVersion': 'v1',
'kind': 'policy',
'metadata': {'name': 'policy1'},
@@ -650,7 +659,8 @@ class TestCreateFromFile(TestBase):
'ports': [1, 2, 3, 4],
'tag': 'web'}}],
'order': 100000,
- 'selector': ""}},
+ 'selector': "",
+ 'types': ['ingress', 'egress']}},
),
("ipPool",
{'apiVersion': 'v1',
