Skip to content

Conversation

mpminardi
Copy link
Member

Add an optional reset_acl_on_destroy attribute to the tailscale_acl resource which causes the ACL on the Taislcale control plane to be reset to the default ACL when the resource is destroyed.

Updates #426

@mpminardi mpminardi self-assigned this Feb 6, 2025
@mpminardi mpminardi requested a review from oxtoacart February 6, 2025 14:51
return nil
}
client := m.(*tsclient.Client)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would have expected this whitespace before line 163 instead of after, but that may very well just be me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops good call this does look a little wonky, will fix.


// Setting the ACL to an empty string resets its value to the default.
if err := client.PolicyFile().Set(ctx, "", ""); err != nil {
return diagnosticsError(err, "Failed to set ACL")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Failed to set ACL" or "Failed to reset ACL" or "Failed to delete ACL" or ???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm maybe "Failed to reset ACL" would be the most accurate to what the intent here is? Will adjust.

@mpminardi mpminardi force-pushed the mpminardi/acl-reset-on-destroy branch from f233aef to 42a2c93 Compare February 6, 2025 19:28
Add an optional `reset_acl_on_destroy` attribute to the `tailscale_acl`
resource which causes the ACL on the Taislcale control plane to be reset
to the default ACL when the resource is destroyed.

Updates #426

Signed-off-by: Mario Minardi <mario@tailscale.com>
@mpminardi mpminardi force-pushed the mpminardi/acl-reset-on-destroy branch from 42a2c93 to 60072eb Compare February 6, 2025 21:49
@mpminardi mpminardi merged commit bc18edf into main Feb 6, 2025
5 checks passed
@mpminardi mpminardi deleted the mpminardi/acl-reset-on-destroy branch February 6, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants