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 identityGroupExists #1567

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

czembower
Copy link
Contributor

@czembower czembower commented Aug 5, 2022

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

Closes #1525

Release note for CHANGELOG:

fixed condition where missing/deleted entity group caused Terraform to error instead of recreate the resource

}

log.Printf("[DEBUG] Checking if IdentityGroup %q exists", key)
resp, err := readIdentityGroup(client, id, true)
resp, err := client.Logical().Read(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change will break the client controlled consistency (CCC) bits. We may need to take a closer look at the issue.

Copy link
Contributor

@benashz benashz Oct 5, 2022

Choose a reason for hiding this comment

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

Since we are no longer supporting schema.Resource.Exists, we can just call d.SetId("") in identityGroupRead() when resp is nil. Then drop identityGroupExists() all together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks @benashz

@benashz benashz added this to the 3.9.1 milestone Oct 5, 2022
Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Looks good to me and seems to resolve the underlying issue. Thank you for your contribution to HashiCorp! :)

@benashz benashz merged commit 8d04d66 into hashicorp:main Oct 6, 2022
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
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.

vault_identity_group resource fails to recreate group if missing from Vault
3 participants