-
Notifications
You must be signed in to change notification settings - Fork 49
tailscale: add contacts
resource
#387
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
Conversation
3eee341
to
ca92fe6
Compare
9672b7c
to
a0ed2e9
Compare
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.
Just a couple of suggestions about maybe making it a little more DRY, otherwise LGTM. Nice job on the documentation piece!
tailscale/resource_contacts.go
Outdated
return diagnosticsError(err, "Failed to fetch contacts") | ||
} | ||
|
||
accountMap := []map[string]interface{}{ |
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.
These feel somewhat repetitive, could maybe be pulled into a function like buildContact()
or something?
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.
Have added a buildContactMap
function to clean this up a bit.
tailscale/resource_contacts.go
Outdated
client := m.(*tailscale.Client) | ||
|
||
if d.HasChange("account") { | ||
account := d.Get("account").(*schema.Set).List() |
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.
These sections feel a little repetitive, maybe they could be pulled into a helper function?
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.
Made an updateContact
helper to encapsulate some of the repetitive bits here.
9ff27ef
to
0b27a26
Compare
Add a `tailscale_contacts` resource to allow for managing tailscale contacts settings via Terraform. Updates tailscale/corp#21631 Signed-off-by: Mario Minardi <mario@tailscale.com>
a0ed2e9
to
eccd7ef
Compare
Add a
tailscale_contacts
resource to allow for managing tailscale contacts settings via Terraform.Updates https://github.com/tailscale/corp/issues/21631