-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat(teams) Add custom role data source #382
Conversation
} | ||
|
||
func dataSourceSysdigCustomRoleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { | ||
client, err := m.(SysdigClients).sysdigCommonClientV2() |
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 would do a check regarding the type cast, to avoid any panic in the application
cli, ok := m.(SysdigClients)
return diag.FromErr(err) | ||
} | ||
|
||
name := d.Get("name").(string) |
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.
Same here
} | ||
|
||
d.SetId(strconv.Itoa(customRole.ID)) | ||
_ = d.Set("name", customRole.Name) |
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.
feel free to omit the _ =
if you don't need them :)
ef1aea0
to
8b3c7f1
Compare
closing everything will be done in #383 |
This is first PR in order to add tthe ability to assign custom roles to users in teams
Changes made in the PR:
Tests are missing and will be added in a later stage, when we introduce the custom role resource.