Skip to content
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

Document that ACL tests are run when creating and updating tailscale_acl resources. #325

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

dsymonds
Copy link
Contributor

@dsymonds dsymonds commented Jan 28, 2024

Fixes #158.
Closes #161.

@dsymonds
Copy link
Contributor Author

@clstokes @davidsbond @knyar

I've tested this manually, but not sure how easy or useful it is to add a unit test.

@knyar
Copy link
Collaborator

knyar commented Jan 30, 2024

Thank you! I might be missing something, but what does this achieve if validation is only called immediately before attempting to set ACL contents with the same value? The same validation (including tests) will be applied while ACL content is being set, and an error should be returned if any of the tests fail.

@dsymonds
Copy link
Contributor Author

That's a good point! For some reason I thought this wasn't happening, but just tested it manually now and the tests do indeed get exercised.

Okay, let me pare this right back to just the documentation update.

@dsymonds dsymonds force-pushed the main branch 2 times, most recently from c8e05de to 554ea8c Compare January 30, 2024 21:36
@dsymonds dsymonds changed the title Run ACL tests when creating and updating tailscale_acl resources. Document that ACL tests are run when creating and updating tailscale_acl resources. Jan 30, 2024
@dsymonds
Copy link
Contributor Author

PTAL @knyar

@knyar
Copy link
Collaborator

knyar commented Feb 1, 2024

I think the markdown files get generated based on the source code, so I suspect you'd actually need to make the change in resource_acl.go and run go generate.

@dsymonds
Copy link
Contributor Author

dsymonds commented Feb 2, 2024

Ah ha! I overlooked the very subtle "generated" comment at the top. Done properly now.

PTAL @knyar

Copy link
Collaborator

@knyar knyar left a comment

Choose a reason for hiding this comment

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

Thank you!

@knyar knyar merged commit 5458573 into tailscale:main Feb 2, 2024
3 checks passed
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.

allowing validating the ACL tests before terraform apply
2 participants