vishesh92 commented on code in PR #203:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/203#discussion_r2302985741
##########
cloudstack/resource_cloudstack_network_acl_rule.go:
##########
@@ -623,6 +644,16 @@ func verifyNetworkACLParams(d *schema.ResourceData) error {
}
func verifyNetworkACLRuleParams(d *schema.ResourceData, rule
map[string]interface{}) error {
+ if ruleNum, ok := rule["rule_number"]; ok && ruleNum != nil {
+ if rId, ok := ruleNum.(int); ok && rId != 0 {
+ // Validate only if rule_number is explicitly set
(non-zero)
+ if rId < 1 || rId > 65535 {
+ return fmt.Errorf(
+ "%q must be between %d and %d
inclusive, got: %d", "rule_number", 1, 65535, rId)
+ }
+ }
Review Comment:
```suggestion
if number, ok := ruleNum.(int); ok && number != 0 {
// Validate only if rule_number is explicitly set
(non-zero)
if number < 1 || number > 65535 {
return fmt.Errorf(
"%q must be between %d and %d
inclusive, got: %d", "rule_number", 1, 65535, number)
}
}
```
--
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]