1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Fix partially re-used fallback chain

This commit is contained in:
Viranch Mehta
2021-06-25 13:58:00 -07:00
parent d6deabcc52
commit 4848246712
2 changed files with 16 additions and 3 deletions

View File

@@ -837,8 +837,8 @@ class AzureProvider(BaseProvider):
pool['fallback'] = pool_name
if pool_name in pools:
# we've already populated the pool
continue
# we've already populated this and subsequent pools
break
# populate the pool from Weighted profile
# these should be leaf node entries with no further nesting

View File

@@ -1687,6 +1687,12 @@ class TestAzureDnsProvider(TestCase):
'value': 'default.unit.tests.',
'dynamic': {
'pools': {
'sto': {
'values': [
{'value': 'sto.unit.tests.'},
],
'fallback': 'iad',
},
'iad': {
'values': [
{'value': 'iad.unit.tests.'},
@@ -1702,13 +1708,14 @@ class TestAzureDnsProvider(TestCase):
'rules': [
{'geos': ['EU'], 'pool': 'iad'},
{'geos': ['EU-GB'], 'pool': 'lhr'},
{'geos': ['EU-SE'], 'pool': 'sto'},
{'pool': 'lhr'},
],
}
})
profiles = provider._generate_traffic_managers(record)
self.assertEqual(len(profiles), 3)
self.assertEqual(len(profiles), 4)
self.assertTrue(_profile_is_match(profiles[-1], Profile(
name='foo--unit--tests',
traffic_routing_method='Geographic',
@@ -1728,6 +1735,12 @@ class TestAzureDnsProvider(TestCase):
target_resource_id=profiles[1].id,
geo_mapping=['GB', 'WORLD'],
),
Endpoint(
name='rule-sto',
type=nested,
target_resource_id=profiles[2].id,
geo_mapping=['SE'],
),
],
)))