Skip to content

Commit

Permalink
Show an error message when nodes size is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
zulh-civo authored and saiyam1814 committed Aug 12, 2021
1 parent c1b08c4 commit 9922b3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions civo/resource_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ func resourceKubernetesClusterUpdate(d *schema.ResourceData, m interface{}) erro

config := &civogo.KubernetesClusterConfig{}

if d.HasChange("target_nodes_size") {
errMsg := []string{
"[ERR] Unable to update 'target_nodes_size' after creation.",
"Please create a new node pool with the new node size.",
}
return fmt.Errorf(strings.Join(errMsg, " "))
}

if d.HasChange("num_target_nodes") {
config.NumTargetNodes = d.Get("num_target_nodes").(int)
config.Region = apiClient.Region
Expand Down

0 comments on commit 9922b3b

Please sign in to comment.