-
Notifications
You must be signed in to change notification settings - Fork 207
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
Adding type to data okta group #217
Adding type to data okta group #217
Conversation
This should be changed to optionally include the type if used, maybe something like:
|
@tgoodsell-tempus mind taking another look at this? TY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
okta/data_source_okta_group.go
Outdated
"type": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is interface{}
, so it will set 0
as a default group type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I'm trying to read up on where that comes from - can you give me an article or documentation reference to look at?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has something to do with how the terraform converts values from the interface into the value. Because type is schema.TypeString
, I think it just represents false as 0 (because false internally is just integer) and then converts it into the string (using strings.Itoa
I guess), which is "0".
Re-creating this PR from #155 since I royally screwed up a merge. I believe I have merged this much better now and should be only additions for the functionality I'm attempting to implement.
Description for original PR:
This PR adds the ability to filter by a type in the okta_group data entity.
This is useful in cases were Okta is managed groups from multiple sources (LDAP, Google groups, etc.) that have the same name but different types.
It additionally returns the type as an attribute of the entity.