hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
451 stars 535 forks source link

Serialize data_json as well as data on read of kvv1 #2144

Closed joey-squid closed 3 months ago

joey-squid commented 5 months ago

Description

When reading a kvv1 secret, this PR updates both data_json and data (previously this was just data). This catches any discrepancies and drifts.

Note that this may cause diffs to appear where they didn't before. This is because the diffs were always there but ignored by default.

Closes #2143

Checklist

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccKVSecret'
Test and changelog
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -run=TestAccKVSecret -timeout 30m ./...
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage  [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate  [no test files]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/consts   [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/group   [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/mfa [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/pki  [no test files]
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/internal/sync [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util  (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault 4.236s

Community Note

hashicorp-cla commented 5 months ago

CLA assistant check
All committers have signed the CLA.

joey-squid commented 5 months ago

Not sure how to run tests against other versions of Vault. (I'm also not sure my change is even correct, but that's a different story :) )

fairclothjm commented 3 months ago

Superseded by https://github.com/hashicorp/terraform-provider-vault/pull/2207