-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_kubernetes_cluster
- support for the web_app_routing.dns_zone_ids
property
#26117
Changes from 5 commits
24600a3
e05cba3
af50e1f
7be2c86
e89daf1
8c30ea4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -886,7 +886,26 @@ func TestAccKubernetesCluster_customCATrustEnabled(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccKubernetesCluster_webAppRoutingWithMultipleDnsZone(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") | ||
r := KubernetesClusterResource{} | ||
|
||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.webAppRoutingWithMultipleDnsZone(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
check.That(data.ResourceName).Key("web_app_routing.0.web_app_routing_identity.#").HasValue("1"), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} | ||
|
||
func TestAccKubernetesCluster_webAppRouting(t *testing.T) { | ||
if !features.FourPointOhBeta() { | ||
t.Skip("Skipping test in 4.0 as `dns_zone_id` is removed") | ||
} | ||
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") | ||
r := KubernetesClusterResource{} | ||
|
||
|
@@ -912,11 +931,22 @@ func TestAccKubernetesCluster_webAppRouting(t *testing.T) { | |
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep("web_app_routing.0.dns_zone_id", "web_app_routing.0.dns_zone_ids.#", "web_app_routing.0.dns_zone_ids.0"), | ||
{ | ||
Config: r.webAppRoutingWithMultipleDnsZone(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
check.That(data.ResourceName).Key("web_app_routing.0.web_app_routing_identity.#").HasValue("1"), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} | ||
|
||
func TestAccKubernetesCluster_webAppRoutingPrivateDNS(t *testing.T) { | ||
if !features.FourPointOhBeta() { | ||
t.Skip("Skipping test in 4.0 as `dns_zone_id` is removed") | ||
} | ||
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") | ||
r := KubernetesClusterResource{} | ||
|
||
|
@@ -928,7 +958,7 @@ func TestAccKubernetesCluster_webAppRoutingPrivateDNS(t *testing.T) { | |
check.That(data.ResourceName).Key("web_app_routing.0.web_app_routing_identity.#").HasValue("1"), | ||
), | ||
}, | ||
data.ImportStep(), | ||
data.ImportStep("web_app_routing.0.dns_zone_id", "web_app_routing.0.dns_zone_ids.#", "web_app_routing.0.dns_zone_ids.0"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to add these here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because in this test config, this feature is specified with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test will fail in 4.0 mode, so can we add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ms-henglu, this test as well as |
||
}) | ||
} | ||
|
||
|
@@ -3080,6 +3110,53 @@ resource "azurerm_kubernetes_cluster" "test" { | |
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) | ||
} | ||
|
||
func (KubernetesClusterResource) webAppRoutingWithMultipleDnsZone(data acceptance.TestData) string { | ||
return fmt.Sprintf(` | ||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-aks-%[2]d" | ||
location = "%[1]s" | ||
} | ||
|
||
resource "azurerm_dns_zone" "test" { | ||
name = "acctestzone%[2]d.com" | ||
resource_group_name = azurerm_resource_group.test.name | ||
} | ||
|
||
resource "azurerm_dns_zone" "test2" { | ||
name = "acctestzone2%[2]d.com" | ||
resource_group_name = azurerm_resource_group.test.name | ||
} | ||
|
||
resource "azurerm_kubernetes_cluster" "test" { | ||
name = "acctestaks%[2]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
dns_prefix = "acctestaks%[2]d" | ||
|
||
default_node_pool { | ||
name = "default" | ||
node_count = 1 | ||
vm_size = "Standard_DS2_v2" | ||
upgrade_settings { | ||
max_surge = "10%%" | ||
} | ||
} | ||
|
||
identity { | ||
type = "SystemAssigned" | ||
} | ||
|
||
web_app_routing { | ||
dns_zone_ids = [azurerm_dns_zone.test.id, azurerm_dns_zone.test2.id] | ||
} | ||
} | ||
`, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
||
func (KubernetesClusterResource) webAppRouting(data acceptance.TestData) string { | ||
return fmt.Sprintf(` | ||
provider "azurerm" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to revert this