-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http_application_routing ForceNew removed
- Loading branch information
Aris van Ommeren
committed
Nov 17, 2020
1 parent
e30fcf8
commit 97680cf
Showing
3 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,12 +244,12 @@ func testAccAzureRMKubernetesCluster_addonProfileOMSToggle(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAzureRMKubernetesCluster_addonProfileRouting(t *testing.T) { | ||
func TestAccAzureRMKubernetesCluster_addonProfileRoutingToggle(t *testing.T) { | ||
checkIfShouldRunTestsIndividually(t) | ||
testAccAzureRMKubernetesCluster_addonProfileRouting(t) | ||
testAccAzureRMKubernetesCluster_addonProfileRoutingToggle(t) | ||
} | ||
|
||
func testAccAzureRMKubernetesCluster_addonProfileRouting(t *testing.T) { | ||
func testAccAzureRMKubernetesCluster_addonProfileRoutingToggle(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") | ||
|
||
resource.ParallelTest(t, resource.TestCase{ | ||
|
@@ -262,7 +262,18 @@ func testAccAzureRMKubernetesCluster_addonProfileRouting(t *testing.T) { | |
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMKubernetesClusterExists(data.ResourceName), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.http_application_routing.#", "1"), | ||
resource.TestCheckResourceAttrSet(data.ResourceName, "addon_profile.0.http_application_routing.0.enabled"), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.http_application_routing.0.enabled", "true"), | ||
resource.TestCheckResourceAttrSet(data.ResourceName, "addon_profile.0.http_application_routing.0.http_application_routing_zone_name"), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.oms_agent.#", "0"), | ||
), | ||
}, | ||
data.ImportStep(), | ||
{ | ||
Config: testAccAzureRMKubernetesCluster_addonProfileRoutingConfigDisabled(data), | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMKubernetesClusterExists(data.ResourceName), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.http_application_routing.#", "1"), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.http_application_routing.0.enabled", "false"), | ||
resource.TestCheckResourceAttrSet(data.ResourceName, "addon_profile.0.http_application_routing.0.http_application_routing_zone_name"), | ||
resource.TestCheckResourceAttr(data.ResourceName, "addon_profile.0.oms_agent.#", "0"), | ||
), | ||
|
@@ -693,3 +704,47 @@ resource "azurerm_kubernetes_cluster" "test" { | |
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) | ||
} | ||
|
||
func testAccAzureRMKubernetesCluster_addonProfileRoutingConfigDisabled(data acceptance.TestData) 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" | ||
linux_profile { | ||
admin_username = "acctestuser%d" | ||
ssh_key { | ||
key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt [email protected]" | ||
} | ||
} | ||
default_node_pool { | ||
name = "default" | ||
node_count = 1 | ||
vm_size = "Standard_DS2_v2" | ||
} | ||
addon_profile { | ||
http_application_routing { | ||
enabled = false | ||
} | ||
} | ||
identity { | ||
type = "SystemAssigned" | ||
} | ||
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters