Skip to content

Commit 0c8818e

Browse files
fix: Allow Pub/Sub Topic update to remove schema settings (#11038)
1 parent a8fd825 commit 0c8818e

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

mmv1/products/pubsub/Topic.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ properties:
124124
name: 'schemaSettings'
125125
description: |
126126
Settings for validating messages published against a schema.
127-
default_from_api: true
128127
properties:
129128
- !ruby/object:Api::Type::String
130129
name: 'schema'

mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ func TestAccPubsubTopic_schema(t *testing.T) {
9393
{
9494
Config: testAccPubsubTopic_updateWithNewSchema(topic, schema2),
9595
},
96+
{
97+
Config: testAccPubsubTopic_updateWithNewSchema(topic, ""),
98+
},
9699
{
97100
ResourceName: "google_pubsub_topic.bar",
98101
ImportStateId: topic,
@@ -228,7 +231,8 @@ resource "google_pubsub_topic" "bar" {
228231
}
229232

230233
func testAccPubsubTopic_updateWithNewSchema(topic, schema string) string {
231-
return fmt.Sprintf(`
234+
if schema != "" {
235+
return fmt.Sprintf(`
232236
resource "google_pubsub_schema" "foo" {
233237
name = "%s"
234238
type = "PROTOCOL_BUFFER"
@@ -243,6 +247,13 @@ resource "google_pubsub_topic" "bar" {
243247
}
244248
}
245249
`, schema, topic)
250+
} else {
251+
return fmt.Sprintf(`
252+
resource "google_pubsub_topic" "bar" {
253+
name = "%s"
254+
}
255+
`, topic)
256+
}
246257
}
247258

248259
func testAccPubsubTopic_updateWithKinesisIngestionSettings(topic string) string {

mmv1/third_party/terraform/website/docs/guides/version_6_upgrade.html.markdown

+6
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,9 @@ Description of the change and how users should adjust their configuration (if ne
113113
### `settings.ip_configuration.require_ssl` is now removed
114114

115115
Removed in favor of field `settings.ip_configuration.ssl_mode`.
116+
117+
## Resource: `google_pubsub_topic`
118+
119+
### `schema_settings` no longer has a default value
120+
121+
An empty value means the setting should be cleared.

0 commit comments

Comments
 (0)