Skip to content

Commit

Permalink
Fix pre update validation for primary with secondary config
Browse files Browse the repository at this point in the history
  • Loading branch information
199201shubhamsahu committed Oct 31, 2023
1 parent dfbabfb commit 0e66591
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if d.HasChange("cluster_type") && d.Get("cluster_type") == "SECONDARY" {
}

// Restrict setting secondary_config if cluster_type is PRIMARY
if d.Get("cluster_type") == "PRIMARY" && d.Get("secondary_config") != nil {
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 0e66591

Please sign in to comment.