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

Ensure all callers of readEntity() properly handle errEntityNotFound #1361

Merged
merged 2 commits into from
Feb 25, 2022

Conversation

benashz
Copy link
Contributor

@benashz benashz commented Feb 25, 2022

In #1263 we added better support Vault CCC. This change also brought in a regression related to the handling of entity existence and read and delete methods. This PR should fix that regression.

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

Relates OR Closes #0000

Release note for CHANGELOG:


Output from acceptance testing:

$ make testacc TESTARGS='-v -test.run TestAccIdentity'                                                                                                                                          
ok      github.com/hashicorp/terraform-provider-vault/util      0.435s [no tests to run]
=== RUN   TestAccIdentityEntityAlias
--- PASS: TestAccIdentityEntityAlias (3.38s)
=== RUN   TestAccIdentityEntityAlias_Update
--- PASS: TestAccIdentityEntityAlias_Update (3.24s)
=== RUN   TestAccIdentityEntityAlias_Metadata
--- PASS: TestAccIdentityEntityAlias_Metadata (3.18s)
=== RUN   TestAccIdentityEntityPoliciesExclusive
--- PASS: TestAccIdentityEntityPoliciesExclusive (3.01s)
=== RUN   TestAccIdentityEntityPoliciesNonExclusive
--- PASS: TestAccIdentityEntityPoliciesNonExclusive (3.12s)
=== RUN   TestAccIdentityEntity
--- PASS: TestAccIdentityEntity (1.66s)
=== RUN   TestAccIdentityEntityUpdate
--- PASS: TestAccIdentityEntityUpdate (2.91s)
=== RUN   TestAccIdentityEntityUpdateRemoveValues
--- PASS: TestAccIdentityEntityUpdateRemoveValues (2.93s)
=== RUN   TestAccIdentityEntityUpdateRemovePolicies
--- PASS: TestAccIdentityEntityUpdateRemovePolicies (2.93s)
=== RUN   TestAccIdentityGroupAlias
--- PASS: TestAccIdentityGroupAlias (1.79s)
=== RUN   TestAccIdentityGroupAliasUpdate
--- PASS: TestAccIdentityGroupAliasUpdate (3.22s)
=== RUN   TestAccIdentityGroupMemberEntityIdsExclusiveEmpty
--- PASS: TestAccIdentityGroupMemberEntityIdsExclusiveEmpty (4.38s)
=== RUN   TestAccIdentityGroupMemberEntityIdsExclusive
    resource_identity_group_member_entity_ids_test.go:53: &{{{{0 0} 0 0 0 0} [] {0xc000d38340} false false false false map[] map[] []  [] false 0xc000bce420 false 0 0 testing.tRunner 0xc0007024e0 1 [17887630 17877282 17887295 17882525 30633835 17013223 17214849] TestAccIdentityGroupMemberEntityIdsExclusive {13870639439441694416 35791417733 0x2d1ed00} 0 0xc000671b60 0xc000c4a230 [] {0 0}  <nil> 0} false false 0xc000928780}
--- SKIP: TestAccIdentityGroupMemberEntityIdsExclusive (0.00s)
=== RUN   TestAccIdentityGroupMemberEntityIdsNonExclusiveEmpty
--- PASS: TestAccIdentityGroupMemberEntityIdsNonExclusiveEmpty (4.57s)
=== RUN   TestAccIdentityGroupMemberEntityIdsNonExclusive
    resource_identity_group_member_entity_ids_test.go:123: &{{{{0 0} 0 0 0 0} [] {0xc001a14340} false false false false map[] map[] []  [] false 0xc000bce420 false 0 0 testing.tRunner 0xc0007024e0 1 [17887630 17877282 17887295 17882525 30633835 17013223 17214849] TestAccIdentityGroupMemberEntityIdsNonExclusive {13870639444311307712 40365941116 0x2d1ed00} 0 0xc0014283c0 0xc000dbc070 [] {0 0}  <nil> 0} false false 0xc000928780}
--- SKIP: TestAccIdentityGroupMemberEntityIdsNonExclusive (0.00s)
=== RUN   TestAccIdentityGroupPoliciesExclusive
--- PASS: TestAccIdentityGroupPoliciesExclusive (3.03s)
=== RUN   TestAccIdentityGroupPoliciesNonExclusive
--- PASS: TestAccIdentityGroupPoliciesNonExclusive (3.13s)
=== RUN   TestAccIdentityGroup
--- PASS: TestAccIdentityGroup (1.74s)
=== RUN   TestAccIdentityGroupUpdate
--- PASS: TestAccIdentityGroupUpdate (7.06s)
=== RUN   TestAccIdentityGroupExternal
--- PASS: TestAccIdentityGroupExternal (1.68s)
=== RUN   TestAccIdentityGroup_DuplicateCreate
--- PASS: TestAccIdentityGroup_DuplicateCreate (0.98s)
=== RUN   TestAccIdentityOidcKeyAllowedClientId
--- PASS: TestAccIdentityOidcKeyAllowedClientId (4.96s)
=== RUN   TestAccIdentityOidcKey
--- PASS: TestAccIdentityOidcKey (3.12s)
=== RUN   TestAccIdentityOidcKeyUpdate
--- PASS: TestAccIdentityOidcKeyUpdate (5.32s)
=== RUN   TestAccIdentityOidcRole
--- PASS: TestAccIdentityOidcRole (2.52s)
=== RUN   TestAccIdentityOidcRoleWithClientId
--- PASS: TestAccIdentityOidcRoleWithClientId (2.65s)
=== RUN   TestAccIdentityOidcRoleUpdate
--- PASS: TestAccIdentityOidcRoleUpdate (4.66s)
=== RUN   TestAccIdentityOidc
--- PASS: TestAccIdentityOidc (2.94s)

...

@benashz benashz added this to the 3.3.1 milestone Feb 25, 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 0e4379d into main Feb 25, 2022
@benashz benashz deleted the VAULT-5242/fix-all-callers-of-readEntity branch February 25, 2022 19:44
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.

2 participants