-
Notifications
You must be signed in to change notification settings - Fork 48
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
tailscale: add dns_split_nameservers
resource
#359
Conversation
b7e65d1
to
8cb204b
Compare
return diagnosticsError(err, "Failed to fetch split DNS configs") | ||
} | ||
|
||
nameservers := splitDNS[d.Get("domain").(string)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need something like this to consider the resource deleted when there are no split DNS servers configured for a given domain.
nameservers := splitDNS[d.Get("domain").(string)] | |
nameservers, ok := splitDNS[d.Get("domain").(string)] | |
if !ok { | |
d.SetId("") | |
return | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digging into this a bit more but making this change was breaking import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up changing to use d.Id()
as this is what was breaking the import and is mentioned as necessary here if using schema.ImportStatePassthrough
.
This seems to operate fine without the ok
check in the scenarios I've tested (namely creation, deletion, import, update of split DNS nameservers) so I've left it out for now. The endpoint this is hitting also should not return nil
values for map entries.
f43a9ea
to
9999944
Compare
9c4087f
to
310da05
Compare
310da05
to
856bf8d
Compare
Just chiming in to say I love using Tailscale and this is a feature I have been anticipating for a while! Good work @mpminardi |
Add `resource_dns_split_nameservers` to allow for controlling split DNS settings for a given tailnet. Updates tailscale/corp#19483 Signed-off-by: Mario Minardi <mario@tailscale.com>
856bf8d
to
50149d2
Compare
Add
resource_dns_split_nameservers
to allow for controlling split DNS settings for a given tailnet.Updates https://github.com/tailscale/corp/issues/19483