-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
providers/digitalocean: force fqdn in dns rr value #863
Conversation
Fixes a bug that forces DNS record to be recreated when dealing with records that have domain values (CNAME, MX, NS, etc.)
This LGTM, but let's talk through backwards compatibility. Did this work before? What happens to old resources using this? |
It breaks some ways of using relative domains. Actually, DigitalOcean API has pretty weird behavior. If you create a record with The weird part. A record with I think it's better to suggest users to use only absolute values with hostname-targeted records. |
@paystee Alternatively, can we just tack on a dot if it's not there before setting from the |
@pearkes Yes, we can. But, if I understand this correctly, we still alter the behavior of these resources. This will force new resources for all relative records and absolute records without trailing dot. Actually, if we append a dot to a |
@paystee Yea, I think so! I would try that. |
Added tests for relative and external CNAME values.
It looks like Digital Ocean has changed their API behavior (or may be I did not pay attention to it?). Creating a record with value within a domain always returns relative
Third case is added to avoid creating new resources when specifying relative values in FQDN form, e.g Also, I have added acceptance tests for all these cases. |
This looks fantastic. Tested locally and tests pass, too. Merging. |
Merged! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Digital Ocean requires FQDN value (ending with dot) when creating some records (CNAME, MX, NS, etc.), while GET requests return a value without trailing dot. This forces the resource to be recreated:
This PR fixes the issue. The user must specify absolute value for hostname-targeted records without trailing dot to make it work.
The one downside I see is that it will affect records that were created using relative values (e.g.
a
instead ofa.example.com
).