hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
463 stars 541 forks source link

fix Identity Group externally managed policies lost on update #2084

Closed jeffsanicola closed 11 months ago

jeffsanicola commented 11 months ago

Description

Addresses losing externally managed policies on Vault Identity Group resources. Mirrored changes made in 1950 but for Identity Groups.

Like in 1950, I put tests in the vault_identity_group_policies resource as that seemed like the most appropriate place.

Note: I am using Windows for development and changed line returns from CRLF to LF. The make fmt reformatted all Go files in my local clone so I'm guessing line returns were automatically updated to CRLF when I cloned the repo. If this needs to be adjusted, please do so.

Release note for CHANGELOG: Fix vault_identity_group loses externally managed policies on updates when external_policies = true

Closes #1956

Checklist

Output from acceptance testing:

$ make testacc TESTARGS='-test.run TestAccIdentityGroup'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -test.run TestAccIdentityGroup -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]
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
?       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/internal/identity/entity  (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/mfa     [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/group   [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/pki      [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     128.122s
...

Community Note

hashicorp-cla commented 11 months ago

CLA assistant check
All committers have signed the CLA.