sudo87 commented on PR #337:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/337#issuecomment-5520833327
This works, but `validation.StringInSlice` (from
`terraform-plugin-sdk/v2/helper/validation`) is already the established pattern
in this repo for exactly this case — see e.g.
`resource_cloudstack_instance.go`, `resource_cloudstack_role_permission.go`,
`resource_cloudstack_limits.go`. It's simpler than the manual
`sort.SearchStrings` binary-search fix and drops the need for a custom
`ValidateFunc` closure and the `sort` import:
```go
"hypervisor": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(validHypervisors, false),
},
```
Would suggest switching to that instead for consistency with the rest of the
codebase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]