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

feat(data_source_kv_secret_v2): add the metadata version in returned values #2095

Merged

Conversation

Ameausoone
Copy link
Contributor

Description

This PR add the field "version" in the data source : vault_kv_secret_v2, which is useful when we don't specify the version in input.

Closes #2094

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
    • It's not directly modified the user api IMO, but I could change this.
  • Acceptance tests where run against all supported Vault Versions
    • I didn't modified the tests because Metadatas are not tested against this datasource.

Output from acceptance testing:

I ran tests against the modified data source.

❯ m testacc TESTARGS="-run=TestDataSourceKVV2Secret"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -run=TestDataSourceKVV2Secret -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/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     24.516s
❯ m testacc TESTARGS="-run=TestDataSourceKVV2Secret_deletedSecret"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -run=TestDataSourceKVV2Secret_deletedSecret -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]
ok      github.com/hashicorp/terraform-provider-vault/codegen   0.294s [no tests to run]
?       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]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  0.858s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.989s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.625s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.649s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     6.813s

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

@hashicorp-cla
Copy link

hashicorp-cla commented Nov 22, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@fairclothjm fairclothjm left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @Ameausoone !

@fairclothjm fairclothjm added this to the 3.26.0 milestone Feb 23, 2024
@fairclothjm fairclothjm merged commit 23bd879 into hashicorp:main Feb 23, 2024
2 checks passed
@Ameausoone Ameausoone deleted the feat/add-version-field-data-kv-v2 branch March 4, 2024 09:32
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.

[Enhancement]: Add the field 'version' in vault_kv_secret_v2 data source.
3 participants