Skip to content

Commit

Permalink
r/kubernetes_cluster: fixing tests
Browse files Browse the repository at this point in the history
TestAccAzureRMKubernetesCluster_enableNodePublicIP - ForceNew for a PublicIP
TestAccAzureRMKubernetesCluster_windowsProfile - username is forcenew
  • Loading branch information
tombuildsstuff committed Nov 19, 2019
1 parent bc3e278 commit e07982a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func SchemaDefaultNodePool() *schema.Schema {
"enable_node_public_ip": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},

"max_count": {
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ func resourceArmKubernetesCluster() *schema.Resource {
"admin_username": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"admin_password": {
Type: schema.TypeString,
Expand Down
23 changes: 4 additions & 19 deletions azurerm/resource_arm_kubernetes_cluster_other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func TestAccAzureRMKubernetesCluster_windowsProfile(t *testing.T) {
CheckDestroy: testCheckAzureRMKubernetesClusterDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMKubernetesCluster_windowsProfile(ri, clientId, clientSecret, location, "azureuser"),
Config: testAccAzureRMKubernetesCluster_windowsProfile(ri, clientId, clientSecret, location),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKubernetesClusterExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "kube_config.0.client_key"),
Expand All @@ -319,21 +319,6 @@ func TestAccAzureRMKubernetesCluster_windowsProfile(t *testing.T) {
"service_principal.0.client_secret",
},
},
{
Config: testAccAzureRMKubernetesCluster_windowsProfile(ri, clientId, clientSecret, location, "ricksanchez"),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKubernetesClusterExists(resourceName),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"windows_profile.0.admin_password",
"service_principal.0.client_secret",
},
},
},
})
}
Expand Down Expand Up @@ -609,7 +594,7 @@ resource "azurerm_kubernetes_cluster" "test" {
`, rInt, location, rInt, rInt, version, rInt, clientId, clientSecret)
}

func testAccAzureRMKubernetesCluster_windowsProfile(rInt int, clientId, clientSecret, location, username string) string {
func testAccAzureRMKubernetesCluster_windowsProfile(rInt int, clientId, clientSecret, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
Expand All @@ -631,7 +616,7 @@ resource "azurerm_kubernetes_cluster" "test" {
}
windows_profile {
admin_username = "%s"
admin_username = "azureuser"
admin_password = "P@55W0rd1234!"
}
Expand All @@ -655,5 +640,5 @@ resource "azurerm_kubernetes_cluster" "test" {
service_cidr = "10.10.0.0/16"
}
}
`, rInt, location, rInt, rInt, rInt, username, clientId, clientSecret)
`, rInt, location, rInt, rInt, rInt, clientId, clientSecret)
}
2 changes: 1 addition & 1 deletion website/docs/r/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ A `agent_pool_profile` block supports the following:

* `enable_auto_scaling` - (Optional) Whether to enable [auto-scaler](https://docs.microsoft.com/en-us/azure/aks/cluster-autoscaler). Note that auto scaling feature requires the that the `type` is set to `VirtualMachineScaleSets`

* `enable_node_public_ip` - (Optional) Should each node have a Public IP Address?
* `enable_node_public_ip` - (Optional) Should each node have a Public IP Address? Changing this forces a new resource to be created.

* `min_count` - (Optional) Minimum number of nodes for auto-scaling.

Expand Down

0 comments on commit e07982a

Please sign in to comment.