Skip to content

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

Merged
jasonodonnell merged 2 commits into
hashicorp:masterfrom
husunal:Fix-tf-crash-when-creating-an-entity-that-already-exists
Nov 23, 2020
Merged

Fix Terraform crash when creating an entity that already exists#899
jasonodonnell merged 2 commits into
hashicorp:masterfrom
husunal:Fix-tf-crash-when-creating-an-entity-that-already-exists

Conversation

@husunal

@husunal husunal commented Nov 8, 2020

Copy link
Copy Markdown
Contributor

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

husunal commented Nov 10, 2020

Copy link
Copy Markdown
Contributor Author

The build error is not related to this MR.

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

@jasonodonnell jasonodonnell left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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