Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeKlebolt committed Oct 20, 2023
1 parent f581fa5 commit 6c109ad
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ func TestAccKubernetesCluster_cycleSystemNodePool(t *testing.T) {
),
},
data.ImportStep("default_node_pool.0.temporary_name_for_rotation"),
{
Config: r.enableFips(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("default_node_pool.0.temporary_name_for_rotation"),
})
}

Expand Down Expand Up @@ -711,6 +718,43 @@ resource "azurerm_kubernetes_cluster" "test" {
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger)
}

// write a test to enable fips mode for TestAccKubernetesCluster_cycleSystemNodePool
func (KubernetesClusterResource) enableFips(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"
default_node_pool {
fips_enabled = true
name = "default"
node_count = 1
vm_size = "Standard_DS2_v2"
}
identity {
type = "SystemAssigned"
}
network_profile {
network_plugin = "kubenet"
load_balancer_sku = "standard"
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger)
}

func (KubernetesClusterResource) updateOsDisk(data acceptance.TestData, osDiskType string, osDiskSize int) string {
return fmt.Sprintf(`
provider "azurerm" {
Expand Down

0 comments on commit 6c109ad

Please sign in to comment.