-
Notifications
You must be signed in to change notification settings - Fork 131
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
base: main
Are you sure you want to change the base?
feat: Issue #208: Add no_wrapper settings in push_config #218
Conversation
Hi @imrannayer , @apeabody did anyone of you already had the opportunity to look at this PR? Getting the |
/gcbrun |
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! |
/gcbrun |
/gcbrun |
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.
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] : []) |
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.
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.
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) |
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.
Should never fall back to default, but still might want to set to null
?
write_metadata = lookup(each.value, "write_metadata", true) | |
write_metadata = lookup(each.value, "write_metadata", null) |
The
push_config
forresource "google_pubsub_subscription" "push_subscriptions"
doesn't include theno_wrapper
settings. This has been added.