Skip to content

Commit

Permalink
azurerm_kubernetes_cluster - nil check APIServerAccessProfile (#1…
Browse files Browse the repository at this point in the history
…7005)

* nil check APIServerAccessProfile

* address review comments

Co-authored-by: Tom Harvey <[email protected]>

* lint

Co-authored-by: Tom Harvey <[email protected]>
  • Loading branch information
stephybun and tombuildsstuff authored May 31, 2022
1 parent 38bb07e commit c073b5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,9 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{}

if d.HasChange("run_command_enabled") {
updateCluster = true
if existing.ManagedClusterProperties.APIServerAccessProfile == nil {
existing.ManagedClusterProperties.APIServerAccessProfile = &containerservice.ManagedClusterAPIServerAccessProfile{}
}
existing.ManagedClusterProperties.APIServerAccessProfile.DisableRunCommand = utils.Bool(!d.Get("run_command_enabled").(bool))
}

Expand Down

0 comments on commit c073b5f

Please sign in to comment.