Skip to content

Commit

Permalink
Remove nodepool autoscaling when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst committed Jul 10, 2019
1 parent ee340d3 commit de0b416
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,16 @@ func flattenNodePool(d *schema.ResourceData, config *Config, np *containerBeta.N
"version": np.Version,
}

if np.Autoscaling != nil && np.Autoscaling.Enabled {
nodePool["autoscaling"] = []map[string]interface{}{
map[string]interface{}{
"min_node_count": np.Autoscaling.MinNodeCount,
"max_node_count": np.Autoscaling.MaxNodeCount,
},
if np.Autoscaling != nil {
if np.Autoscaling.Enabled {
nodePool["autoscaling"] = []map[string]interface{}{
{
"min_node_count": np.Autoscaling.MinNodeCount,
"max_node_count": np.Autoscaling.MaxNodeCount,
},
}
} else {
nodePool["autoscaling"] = []map[string]interface{}{}
}
}

Expand Down

0 comments on commit de0b416

Please sign in to comment.