feat: add rbac_roles to coder_workspace_owner data source#330
feat: add rbac_roles to coder_workspace_owner data source#330Emyrk merged 1 commit intocoder:mainfrom
rbac_roles to coder_workspace_owner data source#330Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
d784267 to
7414a32
Compare
|
It does require some coder/coder updates. I have plans to pull in more user context such as |
0c3001a to
9bae197
Compare
Part of coder/terraform-provider-coder#330 Adds support for the coder_workspace_owner.rbac_roles attribute
coder_workspace_owner data source
coder_workspace_owner data sourcerbac_roles to coder_workspace_owner data source
provider/workspace_owner.go
Outdated
| var rbacRoles []string | ||
| if rolesRaw, ok := os.LookupEnv("CODER_WORKSPACE_OWNER_RBAC_ROLES"); ok { | ||
| if err := json.NewDecoder(strings.NewReader(rolesRaw)).Decode(&rbacRoles); err != nil { | ||
| return diag.Errorf("invalid user rbac roles: %s", err.Error()) | ||
| } | ||
| } | ||
| _ = rd.Set("rbac_roles", rbacRoles) |
There was a problem hiding this comment.
CODER_WORKSPACE_OWNER_RBAC_ROLES is now a data structure right?
So we need to json decode the env var, and correct the schema to be an object with 2 fields: name and org_id.
There was a problem hiding this comment.
Correct - I plan to revisit this today or tomorrow and make the updates based on the changes in the other PR
There was a problem hiding this comment.
@Emyrk - Just pushed an update. Let me know if any changes are needed
9bae197 to
8d20979
Compare
|
Hey @Emyrk - Anything else you need from my end? |
This PR updates the schema for the coder_workspace_owner data source to expose rbac_roles.
It's very similar to #287
Relevant
coder/coderPR - coder/coder#16407