-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full support for auto-ttl independant of proxied #65
Conversation
Clearer documentation around auto-ttl (and proxied) ignoring the configured TTL
First pass on testing (no actual applying) with the new changes:
I then updated the rest of the zone config and updated the ttl values to be not 1, just picking for the sake of having a value. It appears that other records are not following the auto setting. I'm seeing We have a pair of cnames that were previously set to ttl 1, were then updated to the following config:
The dry run wants to update them to the ttl value, not the auto value of 1.
There are also
Now:
The above
|
Just pushed a commit that adds some
Might help with debugging this. |
I needed to start over with another domain that I don't have to worry about posting IP info and also this one is inactive so I was given a green light to hose it all up if need be to experiment. I saw a mixed result with this one in the test 'legacy config' pass where we set
After trying an apply, it continued wanting to update 300 > 1, so I added in the One I'm still struggling to get to straighten out is a TXT record.
CF UI shows it as Auto. Dry run wants to update it
Update catches it but looks like it's pushing the
|
At this point I haven't touched the 1 <-> 300 stuff so it'll behave as it had in the past. Now that auto-ttl is a thing I would highly recommend changing the 1's to 300s in the YAML as CF will be ignoring them. You wouldn't get the 1's now if you were to do a dump today. The reasons behind the 1 -> 300 switch still stand. If someone is dumping from CF and going to Route53 or whatever it will get matching behavior. New dumps will have the auto-ttl in there so it'll behave better/correct now in terms of CF. Also CF doesn't support TTL < 60s/120s anyway, so if auto-ttl wasn't there it'd essentially ignore the 1 anyway.
I'll try and dig into this this afternoon and see if I can reproduce something like that. I wasn't able to previously, but I can poke around more. |
Ah, I think I figured out the dissonance here. You were expecting the configured TTL to be ignored when auto-ttl is enabled? I was expecting it to still be checked/match so that other providers would behave as close to CF as possible. Should be easish to resolve. Will push something up later this afternoon |
Aaah yes. The assumption was with the CF auto switch that the provider would ignore the TTL and any other provider would skip it and use the provided. That would allow for CF to auto and say GCloud to set a TTL. |
CF's major outage has kind of put a damper on making and testing the change I had in mind 😁, guess not sure if I'll get a chance to dig into it tomorrow, but will push it whenever I do. |
So I thought I had set things up to ignore the TTL when auto-ttl is enabled and I did. What's actually happening with the
That's taking anything < 120 and making it 120. Fix would initially seem to be to do the same clamping on |
That completely explains why I was getting records with a 2min TTL instead of the auto. I'm so glad you noticed that, it was driving me nuts. I tried it with |
Interestingly the |
So jus pushed up a set of fixes that should result in ignoring TTL when proxied or auto-ttl are enabled. It also fixes the handling of change inclusion/exclusion based on MIN_TTL. |
This is starting to look good on our end. I'm going to test out a few more zones to see if I find any other anomalies. |
Decided this needed more testing and glad I did, found a shortcomming in the implementation faeba7a. Also found a bug/shortcoming in Record.copy and Record.data. Will be opening up an issue on those shortly. |
Ross one thing that's changed is the addition of the Was that intentional? We've got a handful of ad-hoc rules that are getting marked for delete, I'm confirming as to whether or not I'll need to back-fill them. |
No, wasn't intentional. I don't have any of those set up. Can you provide any further details/examples? |
So in this case these are "page rules" where CF will perform a 301 perm redirect to the Here's what a sync dry run says would happen:
If the rule is up there but not switched on, Octo apparently doesn't see it and doesn't want to delete. With it switched on, then Octo sees it and wants to remove it. |
So the URLFWD bit in the diffs should just be a translation of the old stand-alone check here https://github.com/octodns/octodns-cloudflare/pull/65/files#diff-d6838eda1567eb5fb2b061691b90a5092cc1cf8954393cb240eb16a946206db1L528-L530. Only difference I can see is that before it was only checked when proxied was false, but the code in the branches was identical so it should have applied the same logic either way. I don't immediately see what has changed so I'll have to sit down and debug a bit more, I guess I'll need to create some URLFWD's in my account. |
Or you could use a |
Yeah I think I just missed this with all the other TTL noise. I went back to origin and see it's still there so it's just a 'new' thing to us with our upgrading. |
I think we're good to go here. Will leave it a few more days for any final testing/comments and then |
…ing test coverage/cases
Did some more testing and realized that dumps from CF got really noisy with all the auto-ttl/proxied=False stuff included on every record. That's not intended or desired. Pushed a change that only sets those keys if the values are true (missing is the same as false.) In looking over test casees realized there wasn't anything testing _record_for with aut-ttl=True and proxied=False. Added that. |
Full support for auto-ttl independent of proxied. More details in the change to the README.
Clearer documentation around auto-ttl (and proxied) ignoring the configured TTL
This should fully support the permutations that Cloudflare allows. TL;DR is that enabling proxied and/or auto-ttl will ignore the record's in-built TTL. This is indicated to the Cloudflare API with TTL=1, but that implementation detail is not exposed to users of octoDNS.
When dumped (as was previously the case) records with proxied or auto-ttl enabled will have the flags set in the
octodns.cloudflare
section of the record data and the TTL will be set to 300, which is effectively what CF is doing under the hood.I also went through and tested all the permutations of things and their ability to change back and forth between each other and there was a tweak or two to the existing stuff to handle all that better.
/cc #62
/cc @KRoss45 @istr