From 0e6659172a9a0e08d91f8a7a2f5109f0472a1c90 Mon Sep 17 00:00:00 2001 From: Shubham Sahu Date: Tue, 31 Oct 2023 19:25:34 +0530 Subject: [PATCH] Fix pre update validation for primary with secondary config --- mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb b/mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb index cf9d920d033e..0c893e92f2cd 100644 --- a/mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb +++ b/mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb @@ -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.") }