From 55ba8039944edd27011687bc148fea214d5084c2 Mon Sep 17 00:00:00 2001 From: Camilo Aguilar Date: Fri, 10 May 2024 10:22:22 -0400 Subject: [PATCH] kubernetes_cluster_node_pool: Address PR reviews Co-authored-by: Tom Harvey Co-authored-by: stephybun --- .../containers/kubernetes_cluster_node_pool_resource.go | 6 +++++- .../kubernetes_cluster_node_pool_resource_test.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource.go b/internal/services/containers/kubernetes_cluster_node_pool_resource.go index f5bf4cf6dae49..db25ca0de6e13 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource.go @@ -700,8 +700,12 @@ func resourceKubernetesClusterNodePoolCreate(d *pluginsdk.ResourceData, meta int if subnetID != nil { // Wait for vnet to come back to Succeeded before releasing any locks - timeout, _ := ctx.Deadline() + timeout, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("internal-error: context had no deadline") + } + // TODO: refactor this into a `custompoller` within the `network` package stateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(subnets.ProvisioningStateUpdating)}, Target: []string{string(subnets.ProvisioningStateSucceeded)}, diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go index 903d2e25b2583..5f2bd4838f890 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go @@ -2979,7 +2979,7 @@ resource "azurerm_virtual_network" "test" { } resource "azurerm_subnet" "test" { - count = 20 + count = 8 name = "acctestsubnet%d${count.index}" resource_group_name = azurerm_resource_group.test.name virtual_network_name = azurerm_virtual_network.test.name