-
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.
Signed-off-by: JasonWhall <[email protected]>
- Loading branch information
1 parent
072e8e6
commit 4ccd86b
Showing
6 changed files
with
188 additions
and
0 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 |
---|---|---|
|
@@ -19,6 +19,7 @@ var kubernetesAddOnTests = map[string]func(t *testing.T){ | |
"addonProfileAppGatewayAppGatewayId": testAccKubernetesCluster_addonProfileIngressApplicationGateway_appGatewayId, | ||
"addonProfileAppGatewaySubnetCIDR": testAccKubernetesCluster_addonProfileIngressApplicationGateway_subnetCIDR, | ||
"addonProfileAppGatewaySubnetID": testAccKubernetesCluster_addonProfileIngressApplicationGateway_subnetId, | ||
"addonProfileOpenServiceMesh": testAccKubernetesCluster_addonProfileOpenServiceMesh, | ||
} | ||
|
||
var addOnAppGatewaySubnetCIDR string = "10.241.0.0/16" // AKS will use 10.240.0.0/16 for the aks subnet so use 10.241.0.0/16 for the app gateway subnet | ||
|
@@ -341,6 +342,28 @@ func testAccKubernetesCluster_addonProfileIngressApplicationGateway_subnetId(t * | |
}) | ||
} | ||
|
||
func testAccKubernetesCluster_addonProfileOpenServiceMesh(t *testing.T) { | ||
checkIfShouldRunTestsIndividually(t) | ||
testAccKubernetesCluster_addonProfileOpenServiceMesh(t) | ||
} | ||
|
||
func testAccKubernetesCluster_addonProfileOpenServiceMesh(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") | ||
r := KubernetesClusterResource{} | ||
|
||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.addonProfileOpenServiceMeshConfig(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
check.That(data.ResourceName).Key("addon_profile.0.open_service_mesh.#").HasValue("1"), | ||
check.That(data.ResourceName).Key("addon_profile.0.open_service_mesh.0.enabled").HasValue("false"), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} | ||
|
||
func (KubernetesClusterResource) addonProfileAciConnectorLinuxConfig(data acceptance.TestData) string { | ||
return fmt.Sprintf(` | ||
provider "azurerm" { | ||
|
@@ -1095,3 +1118,47 @@ resource "azurerm_kubernetes_cluster" "test" { | |
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) | ||
} | ||
|
||
func (KubernetesClusterResource) addonProfileOpenServiceMeshConfig(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 { | ||
open_service_mesh { | ||
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
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
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