-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add CIDR Validator that matches backend validator #214
Conversation
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.
Nice work! 🙌 Just had a few minor comments
input string | ||
expected diag.Diagnostics | ||
}{ | ||
"blank input 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.
nit on test case organization: I would start with all of the valid test cases together followed by the invalid test cases. and probably worth throwing in a comment line to break them up
|
||
func validateCIDRBlock(v interface{}, path cty.Path) diag.Diagnostics { | ||
var diagnostics diag.Diagnostics | ||
|
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.
I'd add a comment here clarifying what rules are being enforced here (so, the first two documented here: https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/resources/hvn)
🛠️ Description
Adds CIDR Validator and tests to list of validators to match backend validators