diff --git a/internal/services/containers/kubernetes_cluster_auth_resource_test.go b/internal/services/containers/kubernetes_cluster_auth_resource_test.go index e59785f3d2c0..a8764c7626bd 100644 --- a/internal/services/containers/kubernetes_cluster_auth_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_auth_resource_test.go @@ -1046,7 +1046,6 @@ resource "azurerm_kubernetes_cluster" "test" { azure_active_directory_role_based_access_control { tenant_id = var.tenant_id - managed = true } } `, tenantId, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) diff --git a/internal/services/containers/kubernetes_cluster_data_source.go b/internal/services/containers/kubernetes_cluster_data_source.go index 75e2aa612475..5dfb1036686f 100644 --- a/internal/services/containers/kubernetes_cluster_data_source.go +++ b/internal/services/containers/kubernetes_cluster_data_source.go @@ -646,7 +646,6 @@ func dataSourceKubernetesCluster() *pluginsdk.Resource { Computed: true, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - "blob_driver_enabled": { Type: pluginsdk.TypeBool, Computed: true, @@ -716,6 +715,13 @@ func dataSourceKubernetesCluster() *pluginsdk.Resource { }, }, }, + "revisions": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, }, }, }, @@ -725,6 +731,10 @@ func dataSourceKubernetesCluster() *pluginsdk.Resource { } if !features.FourPointOhBeta() { + // adding revisions to the resource is a breaking change, MSFT would like the corresponding change in data source to happen at the same time + serviceMeshProfile := resource.Schema["service_mesh_profile"].Elem.(*pluginsdk.Resource).SchemaMap() + delete(serviceMeshProfile, "revisions") + resource.Schema["agent_pool_profile"].Elem.(*pluginsdk.Resource).Schema["enable_auto_scaling"] = &pluginsdk.Schema{ Type: pluginsdk.TypeBool, Computed: true, @@ -1350,9 +1360,6 @@ func flattenKubernetesClusterDataSourceAzureActiveDirectoryRoleBasedAccessContro result := map[string]interface{}{ "admin_group_object_ids": adminGroupObjectIds, - "client_app_id": clientAppId, - "managed": managed, - "server_app_id": serverAppId, "tenant_id": tenantId, "azure_rbac_enabled": azureRbacEnabled, } diff --git a/internal/services/containers/kubernetes_cluster_other_resource_test.go b/internal/services/containers/kubernetes_cluster_other_resource_test.go index 0e8676bbc038..07d97a4ee04a 100644 --- a/internal/services/containers/kubernetes_cluster_other_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_other_resource_test.go @@ -841,38 +841,6 @@ func TestAccKubernetesCluster_osSkuUpdate(t *testing.T) { }) } -func TestAccKubernetesCluster_osSkuCycleNodePool(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") - r := KubernetesClusterResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.osSkuCycleNodePool(data, "Ubuntu"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("default_node_pool.0.os_sku").HasValue("Ubuntu"), - ), - }, - data.ImportStep("default_node_pool.0.temporary_name_for_rotation"), - { - Config: r.osSkuCycleNodePool(data, "Mariner"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("default_node_pool.0.os_sku").HasValue("Mariner"), - ), - }, - data.ImportStep("default_node_pool.0.temporary_name_for_rotation"), - { - Config: r.osSkuCycleNodePool(data, "AzureLinux"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("default_node_pool.0.os_sku").HasValue("AzureLinux"), - ), - }, - data.ImportStep("default_node_pool.0.temporary_name_for_rotation"), - }) -} - func TestAccKubernetesCluster_microsoftDefender(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{} @@ -984,7 +952,7 @@ func TestAccKubernetesCluster_webAppRoutingWithMultipleDnsZone(t *testing.T) { } func TestAccKubernetesCluster_webAppRouting(t *testing.T) { - if !features.FourPointOhBeta() { + if features.FourPointOhBeta() { t.Skip("Skipping test in 4.0 as `dns_zone_id` is removed") } data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") @@ -1025,7 +993,7 @@ func TestAccKubernetesCluster_webAppRouting(t *testing.T) { } func TestAccKubernetesCluster_webAppRoutingPrivateDNS(t *testing.T) { - if !features.FourPointOhBeta() { + if features.FourPointOhBeta() { t.Skip("Skipping test in 4.0 as `dns_zone_id` is removed") } data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") @@ -1947,7 +1915,7 @@ resource "azurerm_kubernetes_cluster" "test" { node_count = 1 vm_size = "Standard_D2s_v3" message_of_the_day = "daily message" - os_sku = "Mariner" + os_sku = "AzureLinux" workload_runtime = "KataMshvVmIsolation" upgrade_settings { max_surge = "10%%" @@ -3076,41 +3044,6 @@ resource "azurerm_kubernetes_cluster" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, osSKu) } -func (KubernetesClusterResource) osSkuCycleNodePool(data acceptance.TestData, osSKu string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%d" - location = "%s" -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%d" - - default_node_pool { - name = "default" - node_count = 1 - vm_size = "Standard_D2s_v3" - os_sku = "%s" - temporary_name_for_rotation = "temp" - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "SystemAssigned" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, osSKu) -} - func (KubernetesClusterResource) oidcIssuer(data acceptance.TestData, enabled bool) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/containers/kubernetes_cluster_resource_test.go b/internal/services/containers/kubernetes_cluster_resource_test.go index d3d42bd88d51..8beef24d1e1d 100644 --- a/internal/services/containers/kubernetes_cluster_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_resource_test.go @@ -447,7 +447,7 @@ resource "azurerm_route_table" "test" { disable_bgp_route_propagation = false route { name = "internal" - address_prefix = azurerm_virtual_network.test.address_space[0] + address_prefix = tolist(azurerm_virtual_network.test.address_space)[0] next_hop_type = "VnetLocal" } route { diff --git a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go index 782ba4df4df2..30431dfd70ce 100644 --- a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go @@ -188,13 +188,6 @@ func TestAccKubernetesCluster_cycleSystemNodePool(t *testing.T) { ), }, data.ImportStep("default_node_pool.0.temporary_name_for_rotation"), - { - Config: r.updateOsSku(data, "Mariner"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep("default_node_pool.0.temporary_name_for_rotation"), { Config: r.updateZones(data, "Standard_D2ads_v5", "[1,2,3]"), Check: acceptance.ComposeTestCheckFunc( @@ -848,56 +841,6 @@ resource "azurerm_kubernetes_cluster" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, osDiskType, osDiskSize) } -func (KubernetesClusterResource) updateOsSku(data acceptance.TestData, osSku string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%d" - location = "%s" -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%d" - - default_node_pool { - name = "default" - temporary_name_for_rotation = "temp" - node_count = 1 - os_sku = "%s" - vm_size = "Standard_D2ads_v5" - - kubelet_config { - pod_max_pid = 12346 - } - - linux_os_config { - sysctl_config { - vm_swappiness = 40 - } - } - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "SystemAssigned" - } - - network_profile { - network_plugin = "kubenet" - load_balancer_sku = "standard" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, osSku) -} - func (KubernetesClusterResource) addAgentConfig(data acceptance.TestData, numberOfAgents int) string { return fmt.Sprintf(` provider "azurerm" {