Copilot commented on code in PR #203: URL: https://github.com/apache/cloudstack-terraform-provider/pull/203#discussion_r2297908910
########## cloudstack/resource_cloudstack_network_acl_rule.go: ########## @@ -623,6 +644,15 @@ func verifyNetworkACLParams(d *schema.ResourceData) error { } func verifyNetworkACLRuleParams(d *schema.ResourceData, rule map[string]interface{}) error { + if ruleId, ok := rule["rule_id"]; ok && ruleId != nil { + if rId, ok := ruleId.(int); ok && rId > 0 { + if rId < 1 || rId > 65535 { + return fmt.Errorf( + "%q must be between %d and %d inclusive, got: %d", "rule_id", 1, 65535, rId) + } + } + } Review Comment: The validation logic is redundant and incorrect. The condition `rId > 0` on line 648 already ensures the value is greater than 0, making the `rId < 1` check on line 649 unreachable. Remove the `rId < 1` condition. -- 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: dev-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org