Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Feb 27, 2020
1 parent 4cc88b3 commit 1d7894e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2790,9 +2790,12 @@ func flattenMasterAuth(ma *containerBeta.MasterAuth) []map[string]interface{} {

func flattenClusterAutoscaling(a *containerBeta.ClusterAutoscaling) []map[string]interface{} {
r := make(map[string]interface{})
if a == nil || !a.EnableNodeAutoprovisioning {
if a == nil {
r["enabled"] = false
} else {
return []map[string]interface{}{r}
}

if a.EnableNodeAutoprovisioning {
resourceLimits := make([]interface{}, 0, len(a.ResourceLimits))
for _, rl := range a.ResourceLimits {
resourceLimits = append(resourceLimits, map[string]interface{}{
Expand All @@ -2804,6 +2807,8 @@ func flattenClusterAutoscaling(a *containerBeta.ClusterAutoscaling) []map[string
r["resource_limits"] = resourceLimits
r["enabled"] = true
r["auto_provisioning_defaults"] = flattenAutoProvisioningDefaults(a.AutoprovisioningNodePoolDefaults)
} else {
r["enabled"] = false
}
<% unless version == 'ga' -%>
r["autoscaling_profile"] = a.AutoscalingProfile
Expand Down

0 comments on commit 1d7894e

Please sign in to comment.