Skip to content

Commit

Permalink
Add conflicts with, node_version only works on the default node pool (#…
Browse files Browse the repository at this point in the history
…4762)

* Add conflicts with, node_version only works on the default node pool

* Use customizediff rather than conflicts with
  • Loading branch information
slevenick authored May 6, 2021
1 parent 7f2462d commit 488e1cf
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func resourceContainerCluster() *schema.Resource {
customdiff.ForceNewIfChange("enable_l4_ilb_subsetting", isBeenEnabled),
<% end -%>
containerClusterAutopilotCustomizeDiff,
containerClusterNodeVersionRemoveDefaultCustomizeDiff,
),

Timeouts: &schema.ResourceTimeout{
Expand Down Expand Up @@ -4077,6 +4078,14 @@ func containerClusterAutopilotCustomizeDiff(_ context.Context, d *schema.Resourc
return nil
}

// node_version only applies to the default node pool, so it should conflict with remove_default_node_pool = true
func containerClusterNodeVersionRemoveDefaultCustomizeDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error {
if d.Get("node_version").(string) != "" && d.Get("remove_default_node_pool").(bool) {
return fmt.Errorf("node_version can only be specified if remove_default_node_pool is not true")
}
return nil
}

<% unless version == 'ga' -%>
func podSecurityPolicyCfgSuppress(k, old, new string, r *schema.ResourceData) bool {
if k == "pod_security_policy_config.#" && old == "1" && new == "0" {
Expand Down

0 comments on commit 488e1cf

Please sign in to comment.