-
Notifications
You must be signed in to change notification settings - Fork 112
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
Data Source for categories #51
Conversation
|
||
d.SetId(utils.StringValue(resp.Name)) | ||
|
||
list, err := conn.V3.ListCategoryValues(d.Get("name").(string), &v3.CategoryListMetadata{ |
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.
My only concern here is pagination, not really an issue here, but I think there is a limit on how much categories can be created, isn't it?
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.
Yes, I was thinking about it as well, I already have a workaround on this but I think I'll put it in a next enhancement phase.
list, err := conn.V3.ListCategoryValues(d.Get("name").(string), &v3.CategoryListMetadata{ | ||
Kind: utils.StringPtr("category"), | ||
Length: utils.Int64Ptr(500), | ||
}) |
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.
Also, this is kinda hard to read, I know it seems easier to send the struct as an argument instead of creating a variable, but it gives unnecessary length to the call
Length: utils.Int64Ptr(500), | ||
}) | ||
|
||
if err != nil { |
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.
related to the comments above, we can move this if to the call above, instead of leaving it here alone
closes #8
We added category_key data source where you can find the values of the category if it has al least one.