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

feat: Issue #208: Add no_wrapper settings in push_config #218

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

geryonghost
Copy link

The push_config for resource "google_pubsub_subscription" "push_subscriptions"doesn't include the no_wrapper settings. This has been added.

@geryonghost geryonghost marked this pull request as ready for review January 17, 2025 19:59
@geryonghost geryonghost requested review from imrannayer and a team as code owners January 17, 2025 19:59
@dheitepriem
Copy link

Hi @imrannayer , @apeabody

did anyone of you already had the opportunity to look at this PR? Getting the no_wrapper setting into the official module would enable us to switch to upstream again from our internal forked version :)

@geryonghost geryonghost requested a review from a team as a code owner January 31, 2025 13:58
@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

Hi @imrannayer , @apeabody

did anyone of you already had the opportunity to look at this PR? Getting the no_wrapper setting into the official module would enable us to switch to upstream again from our internal forked version :)

Thanks for the contribution @geryonghost!

I've updated against main, and triggered the CI tests. Either @imrannayer or a member of @api-pubsub-and-pubsublite should provide the final review.

Cheers!

@apeabody
Copy link
Contributor

apeabody commented Mar 5, 2025

/gcbrun

@apeabody
Copy link
Contributor

apeabody commented Mar 5, 2025

/gcbrun

Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @geryonghost! A few quick notes:

@@ -212,6 +212,13 @@ resource "google_pubsub_subscription" "push_subscriptions" {
x-goog-version = each.value.minimum_backoff != null ? "x-goog-version" : "v1"
}

dynamic "no_wrapper" {
for_each = (lookup(each.value, "no_wrapper", true) ? [true] : [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest the dynamic block be trigger on the presence of the value, and so default the lookup to null given this variable is optional.

Suggested change
for_each = (lookup(each.value, "no_wrapper", true) ? [true] : [])
for_each = (lookup(each.value, "no_wrapper", null) != null ? [true] : [])

dynamic "no_wrapper" {
for_each = (lookup(each.value, "no_wrapper", true) ? [true] : [])
content {
write_metadata = lookup(each.value, "write_metadata", true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should never fall back to default, but still might want to set to null?

Suggested change
write_metadata = lookup(each.value, "write_metadata", true)
write_metadata = lookup(each.value, "write_metadata", null)

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.

5 participants