Skip to content

Commit

Permalink
Remove cluster update validation for primary to secondary (#10588) (#…
Browse files Browse the repository at this point in the history
…7326)

[upstream:29ad7f672bb64f621878f757096e759bfedae0b7]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored May 7, 2024
1 parent cea8cd8 commit 29c15a3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions google-beta/services/alloydb/resource_alloydb_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,6 @@ func resourceAlloydbClusterUpdate(d *schema.ResourceData, meta interface{}) erro
if err != nil {
return err
}
// Restrict modification of cluster_type from PRIMARY to SECONDARY as it is an invalid operation
if d.HasChange("cluster_type") && d.Get("cluster_type") == "SECONDARY" {
return fmt.Errorf("Can not convert a primary cluster to a secondary cluster.")
}

// Restrict setting secondary_config if cluster_type is PRIMARY
if d.Get("cluster_type") == "PRIMARY" && !tpgresource.IsEmptyValue(reflect.ValueOf(d.Get("secondary_config"))) {
return fmt.Errorf("Can not set secondary config for primary cluster.")
Expand Down

0 comments on commit 29c15a3

Please sign in to comment.