mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Fix wrong re-use of sources for dynamic zones
This commit is contained in:
+2
-2
@@ -516,11 +516,11 @@ class Manager(object):
|
||||
# we've found a dynamic config element
|
||||
|
||||
# find its sources
|
||||
sources = sources or self._get_sources(
|
||||
found_sources = sources or self._get_sources(
|
||||
name, config, eligible_sources
|
||||
)
|
||||
self.log.info('sync: dynamic zone=%s, sources=%s', name, sources)
|
||||
for source in sources:
|
||||
for source in found_sources:
|
||||
if not hasattr(source, 'list_zones'):
|
||||
raise ManagerException(
|
||||
f'dynamic zone={name} includes a source, {source.id}, that does not support `list_zones`'
|
||||
|
||||
@@ -3,17 +3,27 @@ providers:
|
||||
class: octodns.provider.yaml.YamlProvider
|
||||
directory: tests/config
|
||||
|
||||
in2:
|
||||
class: octodns.provider.yaml.YamlProvider
|
||||
directory: tests/config/split
|
||||
|
||||
dump:
|
||||
class: octodns.provider.yaml.YamlProvider
|
||||
directory: env/YAML_TMP_DIR
|
||||
|
||||
zones:
|
||||
'*':
|
||||
'*.one':
|
||||
sources:
|
||||
- in
|
||||
targets:
|
||||
- dump
|
||||
|
||||
'*.two':
|
||||
sources:
|
||||
- in2
|
||||
targets:
|
||||
- dump
|
||||
|
||||
subzone.unit.tests.:
|
||||
sources:
|
||||
- in
|
||||
|
||||
@@ -997,10 +997,14 @@ class TestManager(TestCase):
|
||||
|
||||
manager = Manager(get_config_filename('dynamic-config.yaml'))
|
||||
|
||||
# just unit.tests. which should have been dynamically configured via
|
||||
# two zones which should have been dynamically configured via
|
||||
# list_zones
|
||||
self.assertEqual(
|
||||
23, manager.sync(eligible_zones=['unit.tests.'], dry_run=False)
|
||||
29,
|
||||
manager.sync(
|
||||
eligible_zones=['unit.tests.', 'dynamic.tests.'],
|
||||
dry_run=False,
|
||||
),
|
||||
)
|
||||
|
||||
# just subzone.unit.tests. which was explicitly configured
|
||||
|
||||
Reference in New Issue
Block a user