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

Add update support for pubsub subscription push config field #512

Merged
merged 3 commits into from
Oct 3, 2017

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Oct 2, 2017

Fixes #455.

As discussed in #456, testing in not very practical for the push_config field. You can learn more also here: https://github.com/rosbo/terraform-provider-google/blob/f79044a57c7ed52d13144daa09899dc553e0ec2b/google/resource_pubsub_subscription_test.go#L33. I tested it manually.

@rosbo rosbo requested a review from selmanj October 2, 2017 20:31
@@ -186,3 +188,17 @@ func flattenPushConfig(pushConfig *pubsub.PushConfig) []map[string]interface{} {

return configs
}

func expandPubsubSubscriptionPushConfig(configured []interface{}) *pubsub.PushConfig {
if len(configured) != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: len(configured) == 0 would be more explicit and match the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, easier to read. Done.

google/utils.go Outdated
@@ -318,6 +318,14 @@ func convertStringSet(set *schema.Set) []string {
return s
}

func convertStringMap(v map[string]interface{}) map[string]string {
Copy link
Contributor

Choose a reason for hiding this comment

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

expandStringMap does the same as this i believe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite. expandStringMap works with a schema.ResourceData. This one works with a map[string]interface{}.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rewrite one in terms of the other? expandStringMap can defer to this method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rosbo rosbo merged commit 5f887b6 into hashicorp:master Oct 3, 2017
@rosbo rosbo deleted the pubsub-subscription-update branch October 3, 2017 20:14
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @chrisst
@ghost
Copy link

ghost commented Mar 30, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pubsub Subscription should allow updating push config
2 participants