Skip to content

Commit

Permalink
azurerm_kubernetes_cluster - fix tests (#25200)
Browse files Browse the repository at this point in the history
* `azurerm_kubernetes_cluster` - fix tests

* fix more

* add deprecated message for Azure AD Integration (legacy)

* add default value for max_surge

* update

* update

* remove the block in 4.0

* deprecate managed

* update more tests

* update more tests
  • Loading branch information
ms-henglu authored Apr 15, 2024
1 parent e54098d commit 99c6b37
Show file tree
Hide file tree
Showing 13 changed files with 775 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ resource "azurerm_kubernetes_cluster" "test" {
node_count = 1
vm_size = "Standard_DS2_v2"
vnet_subnet_id = azurerm_subnet.test.id
upgrade_settings {
max_surge = "10%%"
}
}
aci_connector_linux {
Expand Down Expand Up @@ -412,6 +415,9 @@ resource "azurerm_kubernetes_cluster" "test" {
node_count = 1
vm_size = "Standard_DS2_v2"
vnet_subnet_id = azurerm_subnet.test.id
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -454,6 +460,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
azure_policy_enabled = %t
Expand Down Expand Up @@ -514,6 +523,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
oms_agent {
Expand Down Expand Up @@ -576,6 +588,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
oms_agent {
Expand Down Expand Up @@ -619,6 +634,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -657,6 +675,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
http_application_routing_enabled = %t
Expand Down Expand Up @@ -778,6 +799,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
ingress_application_gateway {
Expand Down Expand Up @@ -824,6 +848,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
ingress_application_gateway {
Expand Down Expand Up @@ -867,6 +894,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -919,6 +949,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
ingress_application_gateway {
Expand Down Expand Up @@ -966,6 +999,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
open_service_mesh_enabled = %t
Expand Down Expand Up @@ -1006,6 +1042,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
key_vault_secrets_provider {
Expand Down Expand Up @@ -1049,6 +1088,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
confidential_computing {
Expand Down Expand Up @@ -1091,6 +1133,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func TestAccKubernetesCluster_roleBasedAccessControlDisabled(t *testing.T) {
}

func TestAccKubernetesCluster_roleBasedAccessControlAAD(t *testing.T) {
t.Skip("Azure AD Integration (legacy) (https://aka.ms/aks/aad-legacy) is deprecated, the cluster could not be created with the Azure AD integration (legacy) enabled.")
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test")
r := KubernetesClusterResource{}
clientData := data.Client()
Expand All @@ -167,6 +168,7 @@ func TestAccKubernetesCluster_roleBasedAccessControlAAD(t *testing.T) {
}

func TestAccKubernetesCluster_roleBasedAccessControlAADUpdate(t *testing.T) {
t.Skip("Azure AD Integration (legacy) (https://aka.ms/aks/aad-legacy) is deprecated, the cluster could not be created with the Azure AD integration (legacy) enabled.")
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test")
r := KubernetesClusterResource{}

Expand All @@ -193,6 +195,7 @@ func TestAccKubernetesCluster_roleBasedAccessControlAADUpdate(t *testing.T) {
}

func TestAccKubernetesCluster_roleBasedAccessControlAADUpdateToManaged(t *testing.T) {
t.Skip("Azure AD Integration (legacy) (https://aka.ms/aks/aad-legacy) is deprecated, the cluster could not be created with the Azure AD integration (legacy) enabled.")
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test")
r := KubernetesClusterResource{}
clientData := data.Client()
Expand Down Expand Up @@ -458,6 +461,9 @@ resource "azurerm_kubernetes_cluster" "test" {
node_count = 1
vm_size = "Standard_DS2_v2"
vnet_subnet_id = azurerm_subnet.test.id
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -501,6 +507,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -537,6 +546,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -575,6 +587,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -630,6 +645,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -675,6 +693,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -715,6 +736,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -755,6 +779,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -800,6 +827,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -845,6 +875,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -890,6 +923,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -934,6 +970,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 2
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -977,6 +1016,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -1022,6 +1064,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down Expand Up @@ -1082,6 +1127,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
service_principal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestAccDataSourceKubernetesCluster_roleBasedAccessControlAAD_OlderKubernete
}

func TestAccDataSourceKubernetesCluster_roleBasedAccessControlAAD(t *testing.T) {
t.Skip("Azure AD Integration (legacy) (https://aka.ms/aks/aad-legacy) is deprecated, the cluster could not be created with the Azure AD integration (legacy) enabled.")
data := acceptance.BuildTestData(t, "data.azurerm_kubernetes_cluster", "test")
r := KubernetesClusterDataSource{}
clientId := os.Getenv("ARM_CLIENT_ID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ resource "azurerm_kubernetes_cluster" "test" {
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
upgrade_settings {
max_surge = "10%%"
}
}
identity {
Expand Down
Loading

0 comments on commit 99c6b37

Please sign in to comment.