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 Terraform crash when creating an entity that already exists #899

Merged
merged 2 commits into from
Nov 23, 2020
Merged

Fix Terraform crash when creating an entity that already exists #899

merged 2 commits into from
Nov 23, 2020

Conversation

husunal
Copy link
Contributor

@husunal husunal commented Nov 8, 2020

Fixes terraform crash due to panic: runtime error: invalid memory address or nil pointer dereference when trying to write an identity entity that already exists.

Related issues: #451, #734

Output from acceptance testing:

❯ make testacc TESTARGS='-run=TestAccIdentityEntity'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccIdentityEntity -timeout 120m
?       github.com/terraform-providers/terraform-provider-vault [no test files]
?       github.com/terraform-providers/terraform-provider-vault/cmd/coverage    [no test files]
?       github.com/terraform-providers/terraform-provider-vault/cmd/generate    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/codegen (cached) [no tests to run]
?       github.com/terraform-providers/terraform-provider-vault/generated       [no test files]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/datasources/transform/decode  (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/datasources/transform/encode  (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/resources/transform/alphabet  (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/resources/transform/role      (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/resources/transform/template  (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/generated/resources/transform/transformation    (cached) [no tests to run]
?       github.com/terraform-providers/terraform-provider-vault/schema  [no test files]
testing: warning: no tests to run
PASS
ok      github.com/terraform-providers/terraform-provider-vault/util    (cached) [no tests to run]
=== RUN   TestAccIdentityEntityAlias
--- PASS: TestAccIdentityEntityAlias (0.19s)
=== RUN   TestAccIdentityEntityAlias_Update
--- PASS: TestAccIdentityEntityAlias_Update (0.19s)
=== RUN   TestAccIdentityEntityPoliciesExclusive
--- PASS: TestAccIdentityEntityPoliciesExclusive (0.17s)
=== RUN   TestAccIdentityEntityPoliciesNonExclusive
--- PASS: TestAccIdentityEntityPoliciesNonExclusive (0.17s)
=== RUN   TestAccIdentityEntity
--- PASS: TestAccIdentityEntity (0.09s)
=== RUN   TestAccIdentityEntityUpdate
--- PASS: TestAccIdentityEntityUpdate (0.15s)
PASS
ok      github.com/terraform-providers/terraform-provider-vault/vault   1.231s

...

@husunal husunal changed the title Fix tf crash when creating an entity that already exists Fix Terraform crash when creating an entity that already exists Nov 8, 2020
@husunal
Copy link
Contributor Author

husunal commented Nov 10, 2020

The build error is not related to this MR.

@jasonodonnell jasonodonnell added this to the 2.16.1 milestone Nov 19, 2020
Copy link
Contributor

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonodonnell jasonodonnell merged commit cd54808 into hashicorp:master Nov 23, 2020
@yermulnik
Copy link
Contributor

Hi @husunal @jasonodonnell I'd appreciate if you take a look at accompanying PR #1010

dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…icorp#899)

* Fix nil pointer exception

* Add import details to doc
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.

3 participants