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

don't send empty "name" to identity/group #1002

Merged
merged 1 commit into from
Mar 16, 2021
Merged

Conversation

tvoran
Copy link
Member

@tvoran tvoran commented Mar 16, 2021

Vault used to ignore an empty "name" parameter for identity/group, but as of 1.6.3 it throws an error.

vault 1.6.2:

❯ vault write identity/group name=""                                                                                                                 
Key     Value
---     -----
id      fb5d8983-dbf3-410d-6642-2691baf10579
name    group_a8d03a5d

vault 1.6.3:

❯ vault write identity/group name=""
Error writing data to identity/group: Error making API request.

URL: PUT http://127.0.0.1:8200/v1/identity/group
Code: 400. Errors:

* empty group name

This resulted in a few of the TestAccIdentityGroup tests failing, so this PR doesn't set "name" on the data payload unless it's specified.

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

Release note for CHANGELOG:

resource/vault_identity_group: Don't send name parameter unless specified.

Output from acceptance testing:

$ make testacc TESTARGS='-run=^TestAccIdentityGroup'                                                     
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=^TestAccIdentityGroup -timeout 120m
?   	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]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/codegen	1.347s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/generated	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode	0.833s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode	2.138s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet	1.900s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role	1.644s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template	1.413s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation	1.135s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/schema	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/util	0.508s [no tests to run]
=== RUN   TestAccIdentityGroupAlias
--- PASS: TestAccIdentityGroupAlias (0.14s)
=== RUN   TestAccIdentityGroupAliasUpdate
--- PASS: TestAccIdentityGroupAliasUpdate (0.22s)
=== RUN   TestAccIdentityGroupMemberEntityIdsExclusiveEmpty
--- PASS: TestAccIdentityGroupMemberEntityIdsExclusiveEmpty (0.28s)
=== RUN   TestAccIdentityGroupMemberEntityIdsExclusive
--- SKIP: TestAccIdentityGroupMemberEntityIdsExclusive (0.00s)
    resource_identity_group_member_entity_ids_test.go:51: &{{{{0 0} 0 0 0 0} [] {0xc0005aae00} false false false false map[] true false 0 0 testing.tRunner 0xc0005aa100 1 [17906504 17890857 17897223 17892966 33687925 16985990 17175873] TestAccIdentityGroupMemberEntityIdsExclusive {13838484055737031576 652386480 0x32ba280} 0 0xc0004bc5a0 0xc0004bc600 []} false 0xc00046afc0}
=== RUN   TestAccIdentityGroupMemberEntityIdsNonExclusiveEmpty
--- PASS: TestAccIdentityGroupMemberEntityIdsNonExclusiveEmpty (0.30s)
=== RUN   TestAccIdentityGroupMemberEntityIdsNonExclusive
--- SKIP: TestAccIdentityGroupMemberEntityIdsNonExclusive (0.00s)
    resource_identity_group_member_entity_ids_test.go:121: &{{{{0 0} 0 0 0 0} [] {0xc001148e00} false false false false map[] true false 0 0 testing.tRunner 0xc0005aa100 1 [17906504 17890857 17897223 17892966 33687925 16985990 17175873] TestAccIdentityGroupMemberEntityIdsNonExclusive {13838484056032804576 948149750 0x32ba280} 0 0xc0004bc8a0 0xc0004bc900 []} false 0xc00046afc0}
=== RUN   TestAccIdentityGroupPoliciesExclusive
--- PASS: TestAccIdentityGroupPoliciesExclusive (0.19s)
=== RUN   TestAccIdentityGroupPoliciesNonExclusive
--- PASS: TestAccIdentityGroupPoliciesNonExclusive (0.20s)
=== RUN   TestAccIdentityGroup
--- PASS: TestAccIdentityGroup (0.10s)
=== RUN   TestAccIdentityGroupUpdate
--- PASS: TestAccIdentityGroupUpdate (0.41s)
=== RUN   TestAccIdentityGroupExternal
--- PASS: TestAccIdentityGroupExternal (0.10s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	4.111s

@ghost ghost added size/XS labels Mar 16, 2021
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

LGTM

@tvoran tvoran merged commit d7f01d9 into master Mar 16, 2021
@tvoran tvoran deleted the fix_acc_identity_tests branch March 16, 2021 22:30
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