From dd5a2e8c0f05e2c1c832b0987ae2e4c06365a11e Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Wed, 17 Apr 2024 10:02:34 +0800 Subject: [PATCH] `azurerm_kubernetes_cluster_node_pool` - fix `windows_profile.outbound_nat_enabled` plan-diff --- .../kubernetes_cluster_node_pool_resource.go | 2 +- .../kubernetes_cluster_node_pool_resource_test.go | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource.go b/internal/services/containers/kubernetes_cluster_node_pool_resource.go index 8df9dabaeff7..61787523f56d 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource.go @@ -1531,7 +1531,7 @@ func expandAgentPoolWindowsProfile(input []interface{}) *agentpools.AgentPoolWin } func flattenAgentPoolWindowsProfile(input *agentpools.AgentPoolWindowsProfile) []interface{} { - if input == nil { + if input == nil || input.DisableOutboundNat == nil { return []interface{}{} } diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go index 006053f67f0a..2eefddb0cecb 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go @@ -2110,9 +2110,6 @@ resource "azurerm_kubernetes_cluster_node_pool" "test" { vm_size = "Standard_DS2_v2" node_count = 1 os_type = "Windows" - windows_profile { - outbound_nat_enabled = true - } tags = { Os = "Windows" } @@ -2135,9 +2132,6 @@ resource "azurerm_kubernetes_cluster_node_pool" "test" { node_count = 1 os_type = "Windows" os_sku = "Windows2019" - windows_profile { - outbound_nat_enabled = true - } tags = { Os = "Windows" } @@ -2160,9 +2154,6 @@ resource "azurerm_kubernetes_cluster_node_pool" "test" { node_count = 1 os_type = "Windows" os_sku = "Windows2022" - windows_profile { - outbound_nat_enabled = true - } tags = { Os = "Windows" } @@ -2191,9 +2182,6 @@ resource "azurerm_kubernetes_cluster_node_pool" "windows" { vm_size = "Standard_DS2_v2" node_count = 1 os_type = "Windows" - windows_profile { - outbound_nat_enabled = true - } } `, r.templateWindowsConfig(data)) }