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

Fix TTL handling in PKI role #1447

Merged
merged 2 commits into from
May 10, 2022
Merged

Fix TTL handling in PKI role #1447

merged 2 commits into from
May 10, 2022

Conversation

benashz
Copy link
Contributor

@benashz benashz commented May 10, 2022

Drop the DiffSuppressFunc()'s for max_ttl and ttl since they prevent
properly detecting changes. Make them computed values instead.

Closes #418

Output from acceptance testing:

$ time make testacc TESTARGS='-v -test.count 1 -test.run Test*Pki*'

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -v -v -test.count 1 -test.run Test*Pki* -timeout 30m ./...

ok      github.com/hashicorp/terraform-provider-vault/util      0.414s [no tests to run]
=== RUN   TestPkiSecretBackendCert_basic
--- PASS: TestPkiSecretBackendCert_basic (5.54s)
=== RUN   TestPkiSecretBackendCert_revoke
--- PASS: TestPkiSecretBackendCert_revoke (8.40s)
=== RUN   TestPkiSecretBackendCert_renew
--- PASS: TestPkiSecretBackendCert_renew (16.01s)
=== RUN   TestPkiSecretBackendConfigCA_basic
--- PASS: TestPkiSecretBackendConfigCA_basic (1.63s)
=== RUN   TestPkiSecretBackendConfigUrls_basic
--- PASS: TestPkiSecretBackendConfigUrls_basic (7.24s)
=== RUN   TestPkiSecretBackendCrlConfig_basic
--- PASS: TestPkiSecretBackendCrlConfig_basic (6.60s)
=== RUN   TestPkiSecretBackendIntermediateCertRequest_basic
--- PASS: TestPkiSecretBackendIntermediateCertRequest_basic (1.87s)
=== RUN   TestPkiSecretBackendIntermediateSetSigned_basic
--- PASS: TestPkiSecretBackendIntermediateSetSigned_basic (4.41s)
=== RUN   TestPkiSecretBackendRole_basic
--- PASS: TestPkiSecretBackendRole_basic (9.80s)
=== RUN   TestPkiSecretBackendRootCertificate_basic
--- PASS: TestPkiSecretBackendRootCertificate_basic (12.36s)
=== RUN   TestPkiSecretBackendRootSignIntermediate_basic_default
--- PASS: TestPkiSecretBackendRootSignIntermediate_basic_default (10.11s)
=== RUN   TestPkiSecretBackendRootSignIntermediate_basic_pem
--- PASS: TestPkiSecretBackendRootSignIntermediate_basic_pem (3.62s)
=== RUN   TestPkiSecretBackendRootSignIntermediate_basic_der
--- PASS: TestPkiSecretBackendRootSignIntermediate_basic_der (2.93s)
=== RUN   TestPkiSecretBackendRootSignIntermediate_basic_pem_bundle
--- PASS: TestPkiSecretBackendRootSignIntermediate_basic_pem_bundle (4.54s)
=== RUN   TestPkiSecretBackendRootSignIntermediate_basic_pem_bundle_multiple_intermediates
--- PASS: TestPkiSecretBackendRootSignIntermediate_basic_pem_bundle_multiple_intermediates (4.05s)
=== RUN   TestPkiSecretBackendSign_basic
--- PASS: TestPkiSecretBackendSign_basic (3.18s)
=== RUN   TestPkiSecretBackendSign_renew
--- PASS: TestPkiSecretBackendSign_renew (13.47s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     118.037s
make testacc TESTARGS='-v -test.count 1 -test.run Test*Pki*'  75.17s user 29.98s system 84% cpu 2:04.49 total

Drop the DiffSuppressFunc()'s for max_ttl and ttl since they prevent
properly detecting changes.
@benashz benashz requested a review from vinay-gopalan May 10, 2022 22:13
@benashz benashz added this to the 3.6.0 milestone May 10, 2022
Copy link
Contributor

@vinay-gopalan vinay-gopalan left a comment

Choose a reason for hiding this comment

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

LGTM!

@benashz benashz merged commit 7efb37e into main May 10, 2022
@benashz benashz deleted the VAULT-5864/fix-pki-role-ttl-zero branch May 10, 2022 23:10
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
Drop the DiffSuppressFunc()'s for max_ttl and ttl since they prevent
properly detecting changes. Make them computed values instead.

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

Successfully merging this pull request may close these issues.

Cannot update vault_pki_secret_backend_role ttl/max_ttl when set to 0s
2 participants