Closed LukasdeBoer closed 2 years ago
As you can see it no longer tries to create the zone. I suspect it has something to do with the code around this line: https://github.com/octodns/octodns/blob/master/octodns/provider/cloudflare.py#L338.
Yeah looks like it's short-cutting and using no records to indicate that the zone doesn't exist which as you point out isn't a safe assumption.
maybe needs to return None
or throw a (caught) exception when the zone doesn't yet exist. Either way https://github.com/octodns/octodns/blob/master/octodns/provider/cloudflare.py#L336-L337 will need a bit of a tweak.
It looks like the other calls to that property should be safe:
https://github.com/octodns/octodns/blob/81b68de097c34b2c6aa7dcdc59ec396a91e63a21/octodns/provider/cloudflare.py#L557 - in an update case so the zone has to exist to get there
https://github.com/octodns/octodns/blob/81b68de097c34b2c6aa7dcdc59ec396a91e63a21/octodns/provider/cloudflare.py#L663 - same situation, this time in a delete.
PR welcome :grin:
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
We ran into an issue when using the Cloudflare provider for a new, existing zone with no DNS records. It will try to create the zone, even though it already exists:
After creating a single test record
test.domain.com
manually via the Cloudflare interface, this is the result:As you can see it no longer tries to create the zone. I suspect it has something to do with the code around this line: https://github.com/octodns/octodns/blob/master/octodns/provider/cloudflare.py#L338.