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 group import #372

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Fix group import #372

merged 1 commit into from
Aug 28, 2020

Conversation

jermarchand
Copy link
Contributor

After import a Group, theParentIdis not set in the tfstate. So on 'terraform planit show a delete+creation. ThegroupParentId(group *Group)function always set theparentId` with empty string (https://github.com/mrparkers/terraform-provider-keycloak/blob/master/keycloak/group.go#L25)

I propose to keep the findParentGroup recursion function, but instead of just return a boolean, return the parentId found.

@mrparkers
Copy link
Contributor

I experimented with this a bit myself - you're right that it doesn't look like the group parent ID is set on import, and this code change fixes that. However, the tests aren't actually checking this (they pass without your fix). I tried for a bit to get a failing test to verify this but I was not successful, so I'll just approve and merge this anyways.

Thanks for the PR!

@mrparkers mrparkers merged commit 284a132 into keycloak:master Aug 28, 2020
hcl31415 pushed a commit to hcl31415/terraform-provider-keycloak that referenced this pull request Sep 11, 2020
@jermarchand jermarchand deleted the fix-group-import branch October 21, 2020 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants