Skip to content
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

Empty filters no longer allowed, breaking our pipelines #19269

Labels
bug forward/review In review; remove label to forward service/pubsub

Comments

@jakobatfreiheit
Copy link

jakobatfreiheit commented Aug 27, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.9.5

  • provider registry.terraform.io/hashicorp/google v5.43.0
  • provider registry.terraform.io/hashicorp/google-beta v5.43.0

Affected Resource(s)

google_pubsub_subscription

Terraform Configuration

resource "google_pubsub_subscription" "test-subscriptions" {
  for_each = toset([
    "topic.with.filter",
    "topic.without.filter"
  ])

  name    = "${each.value}-subscription-test-service"
  project = local.project_name
  topic   = google_pubsub_topic.product-backbone-topics[each.value].name

  filter = each.value == "topic.with.filter" ? "attributes.for_service=\"test-service\"" : ""

  push_config {
    push_endpoint = "${data.google_cloud_run_service.test-service.status[0].url}/push-me"

    oidc_token {
      service_account_email = google_service_account.serviceaccounts["my-pubsub-sa"].email
    }
  }
}

Debug Output

No response

Expected Behavior

Terraform creates the two subscriptions on the two topics, one with a filter and one without any filter.
This worked in previous versions (v5.42.0).

Actual Behavior

Instead of creating the subscription without a filter, this now causes an error:

Error: "filter" ("") doesn't match regexp "^.{1,256}$"

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

@github-actions github-actions bot added forward/review In review; remove label to forward service/pubsub labels Aug 27, 2024
@jakobatfreiheit
Copy link
Author

jakobatfreiheit commented Aug 27, 2024

Introduced by this commit: 2be944a

Suggested solution in https://github.com/hashicorp/terraform-provider-google/blob/main/google/services/pubsub/resource_pubsub_subscription.go:

ValidateFunc: verify.ValidateRegexp(`^.{1,256}$`),

=>

ValidateFunc: verify.ValidateRegexp(`^.{0,256}$`),

@c2thorn
Copy link
Collaborator

c2thorn commented Aug 27, 2024

This is probably worth backporting into 5.X. Along with the resolution to #15208

I'll leave this open to track that

@roaks3 fyi

@c2thorn c2thorn reopened this Aug 27, 2024
@jakobatfreiheit
Copy link
Author

@rileykarson could we get a patch release for this before the next Monday release?
This is currently blocking all the TF deployments in our project.

@c2thorn
Copy link
Collaborator

c2thorn commented Aug 28, 2024

@rileykarson could we get a patch release for this before the next Monday release? This is currently blocking all the TF deployments in our project.

we'll likely wait for the other issue to be resolved so we can bundle both resolutions into a single patch release.
In the meantime, are you able to pin to the previous provider version to unblock yourself?

@c2thorn
Copy link
Collaborator

c2thorn commented Aug 30, 2024

This was released as a backport in 5.43.1 and is scheduled to be released in 6.1.0 tuesday

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.