pubsub: cannot clear bigquery subscription #8037
Labels
api: pubsub
Issues related to the Pub/Sub API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
In the same vein as #7979, there is a flaw with the logic of clearing BigQuery subscriptions. Setting a zero valued BigQuery subscription is a signal to clear the bigquery subscription, but right now
Update
passes on the emptyBigQueryConfig
instead of anil
one along with the update mask.The flaw comes from
google-cloud-go/pubsub/subscription.go
Lines 849 to 850 in 372dd22
If BigQueryConfig is not nil (in this case, the sentinel clearing value), we immediately try to convert into the proto struct as is, rather than transforming it as
nil
. The fix here is to update thetoProto
method to convert a zero valued config tonil
. To simplify, we only really need to check ifconfig.Table
is equal to the empty string, since we don't allow partial updates.I'm not sure if
PushConfig
suffers the same problem or not, but will investigate this separately.The text was updated successfully, but these errors were encountered: