Skip to content

Commit

Permalink
fix: #120 remove DNS host validation for ICMP check type
Browse files Browse the repository at this point in the history
  • Loading branch information
gigovich committed Dec 4, 2024
1 parent c8d66c3 commit 7cfcda1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions internal/provider/attr_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ func AddressHostnameSchemaAttribute() schema.StringAttribute {
}
}

func AddressHostnameOrIPSchemaAttribute() schema.StringAttribute {
// Use this attribute when the address can be either a hostname or an IP (v4 or v6) address
// Validation in that case done by API.
return schema.StringAttribute{
Required: true,
}
}

func AddressHostnameSchemaAttributeDescription(desc string) schema.StringAttribute {
return schema.StringAttribute{
Description: desc,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_check_icmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewCheckICMPResource(_ context.Context, p *providerImpl) resource.Resource
"id": IDSchemaAttribute(),
"url": URLSchemaAttribute(),
"name": NameSchemaAttribute(),
"address": AddressHostnameSchemaAttribute(),
"address": AddressHostnameOrIPSchemaAttribute(),
"contact_groups": ContactGroupsSchemaAttribute(),
"locations": LocationsSchemaAttribute(p),
"tags": TagsSchemaAttribute(),
Expand Down

0 comments on commit 7cfcda1

Please sign in to comment.