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

resource/cloudflare_origin_ca_certificate: ignore requested_validity changes #1214

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

jacobbednarz
Copy link
Member

@jacobbednarz jacobbednarz commented Sep 22, 2021

In #1078 we shipped a change that would ignore the requested_validity
attribute as it is an ever decreasing value that shouldn't trigger a
change. However, digging into this has surfaced a bug in
terraform-plugin-sdk
that is preventing the schema from providing
the value to the CRUD method due to the presence of DiffSuppressFunc.
Instead of using a DiffSuppressFunc, mark the attribute as Optional
and Computed to allow it to be ignored when it decreases.

Fixes the following acceptance test failure too

=== RUN   TestAccCloudflareOriginCACertificate_Basic
    resource_cloudflare_origin_ca_certificate_test.go:34: Step 1/2 error: Check failed: Check 6/6 error: cloudflare_origin_ca_certificate.mjrtkutxmm: Attribute 'requested_validity' expected "7", got "5475"

Closes #1160

…changes

In #1078 we shipped a change that would ignore the `requested_validity`
attribute as it is an ever decreasing value that shouldn't trigger a
change. However, digging into this has surfaced a bug in
`terraform-plugin-sdk`[1] that is preventing the schema from providing
the value to the CRUD method due to the presence of `DiffSuppressFunc`.
Instead of using a `DiffSuppressFunc`, mark the attribute as Optional
and Computed to allow it to be ignored when it decreases.

```
=== RUN   TestAccCloudflareOriginCACertificate_Basic
    resource_cloudflare_origin_ca_certificate_test.go:34: Step 1/2 error: Check failed: Check 6/6 error: cloudflare_origin_ca_certificate.mjrtkutxmm: Attribute 'requested_validity' expected "7", got "5475"
```

Closes #1160

[1]: hashicorp/terraform-plugin-sdk#806
@jacobbednarz jacobbednarz changed the title resource/cloudflare_origin_ca_certificate: ignore requested_validity … resource/cloudflare_origin_ca_certificate: ignore requested_validity changes Sep 22, 2021
@jacobbednarz jacobbednarz merged commit ec8b79c into master Sep 22, 2021
@jacobbednarz jacobbednarz deleted the handle-request-validity-for-certs branch September 22, 2021 03:48
github-actions bot pushed a commit that referenced this pull request Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Origin CA certificate validity not applied (provider version >= v2.22.0)
1 participant