Skip to content

Commit

Permalink
azurerm_kubernetes_cluster - fix panic @3357 (#27183)
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored Aug 23, 2024
1 parent 22d4c7e commit c4813c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3350,12 +3350,11 @@ func expandKubernetesClusterAPIAccessProfile(d *pluginsdk.ResourceData) *managed
}

apiServerAccessProfileRaw := d.Get("api_server_access_profile").([]interface{})
if len(apiServerAccessProfileRaw) == 0 {
if len(apiServerAccessProfileRaw) == 0 || apiServerAccessProfileRaw[0] == nil {
return apiAccessProfile
}

config := apiServerAccessProfileRaw[0].(map[string]interface{})

if v := config["authorized_ip_ranges"]; v != nil {
apiServerAuthorizedIPRangesRaw := v.(*pluginsdk.Set).List()
if apiServerAuthorizedIPRanges := utils.ExpandStringSlice(apiServerAuthorizedIPRangesRaw); len(*apiServerAuthorizedIPRanges) > 0 {
Expand Down

0 comments on commit c4813c5

Please sign in to comment.