Skip to content

Conversation

@modular-magician
Copy link
Collaborator

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

pubsub: always send `bigqueryConfig` in the updateMask when configured

Closes hashicorp/terraform-provider-google#24891


Reproduced issue in GoogleCloudPlatform/magic-modules@23b53cc with:

make testacc TEST=./google/services/pubsub TESTARGS='-run=TestAccPubsubSubscription_bigquery_config_update'
sh -c "'/Users/ramon/go/src/github.com/hashicorp/terraform-provider-google/scripts/gofmtcheck.sh'"
==> Checking that code complies with gofmt requirements...
go vet
TF_ACC_REFRESH_AFTER_APPLY=1 TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/services/pubsub -v -run=TestAccPubsubSubscription_bigquery_config_update -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccPubsubSubscription_bigquery_config_update
=== PAUSE TestAccPubsubSubscription_bigquery_config_update
=== CONT  TestAccPubsubSubscription_bigquery_config_update
    resource_pubsub_subscription_test.go:673: Step 3/4 error: Error running apply: exit status 1

        Error: Error updating Subscription "projects/magic-modules-dev/subscriptions/tf-test-sub-vv7fn3hktk": googleapi: Error 403: The caller does not have permission

          with google_pubsub_subscription.foo,
          on terraform_plugin_test.tf line 12, in resource "google_pubsub_subscription" "foo":
          12: resource "google_pubsub_subscription" "foo" {

--- FAIL: TestAccPubsubSubscription_bigquery_config_update (104.87s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-google/google/services/pubsub   105.678s
FAIL
make: *** [testacc] Error 1

Resolved issue by always sending the bigqueryConfig in the updateMask just like the google cli does in GoogleCloudPlatform/magic-modules@12b4c37:

make testacc TEST=./google/services/pubsub TESTARGS='-run=TestAccPubsubSubscription_bigquery_config_update'
sh -c "'/Users/ramon/go/src/github.com/hashicorp/terraform-provider-google/scripts/gofmtcheck.sh'"
==> Checking that code complies with gofmt requirements...
go vet
TF_ACC_REFRESH_AFTER_APPLY=1 TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/services/pubsub -v -run=TestAccPubsubSubscription_bigquery_config_update -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccPubsubSubscription_bigquery_config_update
=== PAUSE TestAccPubsubSubscription_bigquery_config_update
=== CONT  TestAccPubsubSubscription_bigquery_config_update
--- PASS: TestAccPubsubSubscription_bigquery_config_update (122.95s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/services/pubsub   126.851s

Waiting for CI to run all the PubSub tests.

Derived from GoogleCloudPlatform/magic-modules#15584

…d (#15584)

[upstream:09e992dcc9b0cceff37104f8d64d7fe62a6beefd]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit e228397 into hashicorp:main Nov 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating an existing PubSub Subscription with BigQuery service_account_email set fails

1 participant