Closed invidian closed 5 years ago
Thanks, I won't be able to look at this immediately, but this looks like a great update.
On Wed, Apr 3, 2019 at 5:05 AM Mateusz Gozdek notifications@github.com wrote:
I didn't have time to test it properly yet (that's why WIP), but still would like to share this work, so maybe someone else can test it as well and start using it.
Closes #2 https://github.com/phillbaker/terraform-provider-mailgunv3/issues/2
You can view, comment on, or merge this pull request online at:
https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7 Commit Summary
- Remove commented code and format all files with gofmt
- Update dependencies
- Add ability to set API base URL
File Changes
- M .travis.yml https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-0 (10)
- M config.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-1 (24)
- D glide.lock https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-2 (249)
- D glide.yaml https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-3 (9)
- A go.mod https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-4 (8)
- A go.sum https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-5 (211)
- M main.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-6 (10)
- M provider.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-7 (50)
- M resource_mailgun_domain.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-8 (357)
- M resource_mailgun_domain_test.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-9 (2)
- M resource_mailgun_route.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-10 (250)
- M resource_mailgun_route_test.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7/files#diff-11 (2)
Patch Links:
- https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7.patch
https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFxKWcdYvbaHHtQbsRfbgMjzuhZOWlDks5vc8Y3gaJpZM4cZH5H .
So, I've made some tests and found few bugs, which are fixed now.
I'm not sure yet about parts with context, I just took it from example https://github.com/mailgun/mailgun-go/blob/master/examples/examples.go#L15-L16.
Creating domain and routes works now.
I also added sensitive to smtp_password field, so it does not leak on plan stage.
I also noticed, that smtp_password
field trigger domain destroy, which is not great, especially, that mailgun-go supports password changing. Perhaps that should be implemented with update-in-place (maybe separated issue, but I don't know if there is a demand for that).
I think it can be reviewed now.
Sounds good!
On Wed, Apr 10, 2019 at 1:39 PM Mateusz Gozdek notifications@github.com wrote:
@invidian commented on this pull request.
In resource_mailgun_domain.go https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7#discussion_r273795800 :
if err != nil {
return fmt.Errorf("Error deleting domain: %s", err) }
// Give the destroy a chance to take effect return resource.Retry(1time.Minute, func() resource.RetryError {
- , , _, err = client.GetSingleDomain(d.Id())
- ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
- defer cancel()
It looks like just context.Background() should be used, examples:
- https://github.com/terraform-providers/terraform-provider-google/blob/1319ddd86de649e62984da8a31ca5643c4ef1787/google/resource_google_project_services.go#L209
So maybe I just change the code to that?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/phillbaker/terraform-provider-mailgunv3/pull/7#discussion_r273795800, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFxKSykCe8R_DZuDP9iFaD_wlZxVf_zks5vfXkYgaJpZM4cZH5H .
Updated with plain context.Background()
.
I didn't have time to test it properly yet (that's why WIP), but still would like to share this work, so maybe someone else can test it as well and start using it.
Closes #2