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

Add CIDR Validator that matches backend validator #214

Merged
merged 7 commits into from
Oct 27, 2021

Conversation

efgold
Copy link
Contributor

@efgold efgold commented Oct 25, 2021

🛠️ Description

Adds CIDR Validator and tests to list of validators to match backend validators

@efgold efgold requested a review from a team as a code owner October 25, 2021 18:17
@efgold efgold requested a review from a team October 25, 2021 18:17
@efgold efgold self-assigned this Oct 25, 2021
Copy link
Contributor

@bcmdarroch bcmdarroch left a 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": {
Copy link
Contributor

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

Copy link
Contributor

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)

@bcmdarroch bcmdarroch merged commit f21b509 into main Oct 27, 2021
@bcmdarroch bcmdarroch deleted the HCPE-1156-add-cidr-validator branch October 27, 2021 19:27
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.

3 participants