Skip to content

Commit

Permalink
Remove nodepool autoscaling when disabled (#931)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and chrisst committed Jul 10, 2019
1 parent 00b76aa commit 8b10f99
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions google-beta/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,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{}{
{
"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 8b10f99

Please sign in to comment.