-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pubsub): allow updating topic schema fields individually #7362
Changes from 6 commits
697e237
c444eeb
cd1b90f
f7513d8
c9beae8
e980aa9
209fea0
c3c5f01
e2a0f6a
04347d8
4a827ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,7 +407,18 @@ func (t *Topic) updateRequest(cfg TopicConfigToUpdate) *pb.UpdateTopicRequest { | |
} | ||
if cfg.SchemaSettings != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does one remove the schema config entirely? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I missed this. I added a section that handles clearing SchemaSettings when it detects the zero value, similar to MessageStoragePolicy. |
||
pt.SchemaSettings = schemaSettingsToProto(cfg.SchemaSettings) | ||
paths = append(paths, "schema_settings") | ||
if pt.SchemaSettings.Schema != "" { | ||
paths = append(paths, "schema_settings.schema") | ||
} | ||
if pt.SchemaSettings.Encoding != pb.Encoding_ENCODING_UNSPECIFIED { | ||
paths = append(paths, "schema_settings.encoding") | ||
} | ||
if pt.SchemaSettings.FirstRevisionId != "" { | ||
paths = append(paths, "schema_settings.first_revision_id") | ||
} | ||
if pt.SchemaSettings.LastRevisionId != "" { | ||
paths = append(paths, "schema_settings.last_revision_id") | ||
} | ||
} | ||
return &pb.UpdateTopicRequest{ | ||
Topic: pt, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also possible to just have schema_settings, which will update all of them. Though I guess the Go library is setting each field explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah each field is set explicitly so updating all of them at once is possible too.