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

use d.SetNewComputed for TypeSet computed attributes #453

Merged
merged 5 commits into from
Aug 6, 2021

Conversation

smaeda-ks
Copy link
Contributor

@smaeda-ks smaeda-ks commented Jul 29, 2021

This attempts to fix: #451

TODO:

Note:
I'm not adding acceptance tests for this change because the update action only runs for "issued" state:
https://github.com/fastly/terraform-provider-fastly/blob/v0.33.0/fastly/resource_fastly_tls_subscription.go#L23

If we're about to add tests, that require tests to interact with DNS records as well as waiting for the subscription to be issued, which isn't ideal in my view.

Reference:
hashicorp/terraform-plugin-sdk#195

@smaeda-ks smaeda-ks added bug enhancement New feature or request labels Jul 29, 2021
@smaeda-ks smaeda-ks self-assigned this Jul 29, 2021
@@ -25,6 +25,7 @@ func resourceFastlyTLSSubscription() *schema.Resource {
customdiff.ForceNewIf("configuration_id", resourceFastlyTLSSubscriptionStateNotIssued),
customdiff.ForceNewIf("domains", resourceFastlyTLSSubscriptionStateNotIssued),
customdiff.ForceNewIf("common_name", resourceFastlyTLSSubscriptionStateNotIssued),
resourceFastlyTLSSubscriptionSetNewComputed,
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be marginally more readable to use the customdiff.ComputedIf() helper method instead of calling d.SetNewComputed() directly? I did a similar thing in #388 but up to you

smaeda-ks and others added 3 commits August 1, 2021 04:41
Co-authored-by: Mark McDonnell <Integralist@users.noreply.github.com>
@smaeda-ks smaeda-ks marked this pull request as ready for review July 31, 2021 23:18
Copy link
Collaborator

@Integralist Integralist left a comment

Choose a reason for hiding this comment

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

LGTM.

@virgofx
Copy link
Contributor

virgofx commented Aug 2, 2021

Any chance we can get this merged and a new point release created? Would love to test this in our environment :)

cc: @smaeda-ks @Integralist

@Integralist Integralist merged commit c1419fc into fastly:main Aug 6, 2021
@Integralist
Copy link
Collaborator

Hi @virgofx I'll be cutting a new release on Monday morning. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updates to TLS Subscription Doesn't update Managed DNS Challenges Value
4 participants