Skip to content

Commit

Permalink
resource/cloudflare_list: remove IsIPAddress validation
Browse files Browse the repository at this point in the history
This was added in 4.7.0 after seeing some incorrect API payloads but the internals of the validation do not take into account a possible CIDR.
  • Loading branch information
jacobbednarz committed May 31, 2023
1 parent 8127fb3 commit f866296
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/2486.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_list: remove `IsIPAddress` validation that doesn't take into account CIDR notation
```
5 changes: 2 additions & 3 deletions internal/sdkv2provider/schema_cloudflare_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ var listItemElem = &schema.Resource{
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ip": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.IsIPAddress,
Type: schema.TypeString,
Optional: true,
},
"redirect": {
Type: schema.TypeList,
Expand Down
1 change: 1 addition & 0 deletions internal/sdkv2provider/schema_cloudflare_list_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func resourceCloudflareListItemSchema() map[string]*schema.Schema {
Description: "Autonomous system number to include in the list",
ExactlyOneOf: []string{"ip", "redirect", "hostname", "asn"},
ForceNew: true,
ValidateFunc: validation.IntAtLeast(1),
},
"hostname": {
Type: schema.TypeList,
Expand Down

0 comments on commit f866296

Please sign in to comment.