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:
@@ -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
|
||||
|
||||
@@ -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'],
|
||||
),
|
||||
],
|
||||
)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user