Currently if there are two zones configured;
- example.com.
- delegated.subdomain.example.com.
When an NS record is created in example.com.yaml as such:
delegated.subdomain:
type: NS
values:
- ns1.example.org.
The NS record for delegated.subdomain.example.com cannot be created as it
throws an exception:
octodns.zone.SubzoneRecordException: Record delegated.subdomain.example.com is under a managed subzone
Additionally, all records other than NS are rejected for
subdomain.example.com..
This is caused by zone_tree being the result of all zones split on '.'
and being added to the tree, even if a zone does not exist at that
point.
To support records where a subzone is dotted, the the map is built such
that each node represents the subdomain of the closest subzone.
Before:
{"com", {"example": {"subdomain": {"delegated": {}}}}}
After:
{"example.com": {"delegated.subdomain": {}}}
Fixes: #378
In Python 2.7 the if statement would catch both cases from the test
test_populate_lenient_fallback, so the test was failing. These are
the error strings differences between Python 2 and 3:
Python 2:
NoLenient: populate() got an unexpected keyword argument 'lenient'
NoZone: populate() got multiple values for keyword argument 'lenient'
Python 3:
NoLenient: populate() got an unexpected keyword argument 'lenient'
NoZone: populate() got multiple values for argument 'lenient'
It can be useful to only synchronize zones that use a certain source. For
example, in a situation where some zones use a dynamic source and others don't,
you probably want to synchronize those with a dynamic source regularly, and
only synchronize the others when a change is made.
Although we only synchronize the zones that use a given source, we still want
to synchronize all sources to avoid deleting records that would live in another
source of the zone.
This commit adds support for zones aliases. This allows to define one or
multiple zone as aliases of an existing zone without using workarounds
like simlinks and miltiple "zones" entries in the configuration file.
An alias zone is share all of its content with it parent zone, only the
name of the zone is different.
```
zones:
example.com.:
aliases:
- example.net.
- example.org.
sources:
- in
targets:
- out
```
Known issues:
- No documentation,
- Only the `octodns-sync` and `octodns-validate` commands supports
aliases zones at this time,
I added a loop in the manager init function which convert all alias
zone to "real" ones during config validation, however I'm not sure
this is the right approach. Comments welcome.