Skip to content

Commit c688b39

Browse files
Remove insightsPostgresOnlyCustomizeDiff function (#6006) (#11699)
Signed-off-by: Modular Magician <[email protected]>
1 parent e0ec7b5 commit c688b39

5 files changed

+15
-22
lines changed

.changelog/6006.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
sql: removed requirement that Cloud SQL Insight is only allowed for Postgres in `google_sql_database_instance`
3+
```

google/resource_clouddeploy_delivery_pipeline_generated_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ resource "google_clouddeploy_delivery_pipeline" "primary" {
7575
description = "basic description"
7676
7777
labels = {
78-
my_first_label = "example-label-1"
79-
8078
my_second_label = "example-label-2"
79+
80+
my_first_label = "example-label-1"
8181
}
8282
8383
project = "%{project_name}"

google/resource_clouddeploy_target_generated_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ resource "google_clouddeploy_target" "primary" {
103103
}
104104
105105
labels = {
106-
my_second_label = "example-label-2"
107-
108106
my_first_label = "example-label-1"
107+
108+
my_second_label = "example-label-2"
109109
}
110110
111111
project = "%{project_name}"
@@ -175,9 +175,9 @@ resource "google_clouddeploy_target" "primary" {
175175
}
176176
177177
labels = {
178-
my_third_label = "example-label-3"
179-
180178
my_second_label = "updated-example-label-2"
179+
180+
my_third_label = "example-label-3"
181181
}
182182
183183
project = "%{project_name}"
@@ -267,9 +267,9 @@ resource "google_clouddeploy_target" "primary" {
267267
}
268268
269269
labels = {
270-
my_third_label = "example-label-3"
271-
272270
my_second_label = "updated-example-label-2"
271+
272+
my_third_label = "example-label-3"
273273
}
274274
275275
project = "%{project_name}"

google/resource_sql_database_instance.go

-10
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ func resourceSqlDatabaseInstance() *schema.Resource {
103103
customdiff.ForceNewIfChange("settings.0.disk_size", isDiskShrinkage),
104104
privateNetworkCustomizeDiff,
105105
pitrPostgresOnlyCustomizeDiff,
106-
insightsPostgresOnlyCustomizeDiff,
107106
),
108107

109108
Schema: map[string]*schema.Schema{
@@ -739,15 +738,6 @@ func pitrPostgresOnlyCustomizeDiff(_ context.Context, diff *schema.ResourceDiff,
739738
return nil
740739
}
741740

742-
func insightsPostgresOnlyCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v interface{}) error {
743-
insights := diff.Get("settings.0.insights_config.0.query_insights_enabled").(bool)
744-
dbVersion := diff.Get("database_version").(string)
745-
if insights && !strings.Contains(dbVersion, "POSTGRES") {
746-
return fmt.Errorf("query_insights_enabled is only available for Postgres now.")
747-
}
748-
return nil
749-
}
750-
751741
func resourceSqlDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) error {
752742
config := meta.(*Config)
753743
userAgent, err := generateUserAgentString(d, config.userAgent)

website/docs/r/clouddeploy_delivery_pipeline.html.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ resource "google_clouddeploy_delivery_pipeline" "primary" {
3333
name = "pipeline"
3434
3535
annotations = {
36-
my_second_annotation = "example-annotation-2"
37-
3836
my_first_annotation = "example-annotation-1"
37+
38+
my_second_annotation = "example-annotation-2"
3939
}
4040
4141
description = "basic description"
4242
4343
labels = {
44-
my_second_label = "example-label-2"
45-
4644
my_first_label = "example-label-1"
45+
46+
my_second_label = "example-label-2"
4747
}
4848
4949
project = "my-project-name"

0 commit comments

Comments
 (0)