From 3b8eae21f3c33094cc5a20eb0537ce3167edfb96 Mon Sep 17 00:00:00 2001 From: Vaerh Date: Fri, 29 Nov 2024 21:24:02 +0300 Subject: [PATCH] fix: routeros_ipv6_dhcp_client prefix_hint validation issue Fixes #609 --- routeros/resource_ipv6_dhcp_client.go | 1 - routeros/resource_ipv6_dhcp_client_test.go | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/routeros/resource_ipv6_dhcp_client.go b/routeros/resource_ipv6_dhcp_client.go index 89ff5866..59cb934c 100644 --- a/routeros/resource_ipv6_dhcp_client.go +++ b/routeros/resource_ipv6_dhcp_client.go @@ -105,7 +105,6 @@ func ResourceIPv6DhcpClient() *schema.Resource { Optional: true, Computed: true, Description: "Include a preferred prefix length.", - ValidateFunc: validation.IsIPv6Address, DiffSuppressFunc: AlwaysPresentNotUserProvided, }, "rapid_commit": { diff --git a/routeros/resource_ipv6_dhcp_client_test.go b/routeros/resource_ipv6_dhcp_client_test.go index 7ef4c8ae..69b404ec 100644 --- a/routeros/resource_ipv6_dhcp_client_test.go +++ b/routeros/resource_ipv6_dhcp_client_test.go @@ -26,6 +26,7 @@ func TestAccIPv6DhcpClient_basic(t *testing.T) { resource.TestCheckResourceAttr(testIPv6DhcpClient, "interface", "ether1"), resource.TestCheckResourceAttr(testIPv6DhcpClient, "pool_name", "inet-provider-pool"), resource.TestCheckResourceAttr(testIPv6DhcpClient, "request.0", "prefix"), + resource.TestCheckResourceAttr(testIPv6DhcpClient, "prefix_hint", "::/60"), ), }, }, @@ -38,10 +39,11 @@ func testAccIPv6DhcpClientConfig() string { return providerConfig + ` resource "routeros_ipv6_dhcp_client" "client" { - request = ["prefix"] - pool_name = "inet-provider-pool" - pool_prefix_length = 64 - interface = "ether1" + request = ["prefix"] + pool_name = "inet-provider-pool" + pool_prefix_length = 64 + interface = "ether1" + prefix_hint = "::/60" } `