-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
@@ -186,3 +188,17 @@ func flattenPushConfig(pushConfig *pubsub.PushConfig) []map[string]interface{} { | |||
|
|||
return configs | |||
} | |||
|
|||
func expandPubsubSubscriptionPushConfig(configured []interface{}) *pubsub.PushConfig { | |||
if len(configured) != 1 { |
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.
Minor: len(configured) == 0
would be more explicit and match the comment
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.
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 { |
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.
expandStringMap does the same as this i believe
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.
Not quite. expandStringMap
works with a schema.ResourceData
. This one works with a map[string]interface{}
.
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.
Can you rewrite one in terms of the other? expandStringMap
can defer to this method
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.
Done
<!-- This change is generated by MagicModules. --> /cc @chrisst
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! |
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.