We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 176fb6a commit ebce4ceCopy full SHA for ebce4ce
provider/workspace.go
@@ -39,9 +39,11 @@ func workspaceDataSource() *schema.Resource {
39
40
ownerGroupsText := os.Getenv("CODER_WORKSPACE_OWNER_GROUPS")
41
var ownerGroups []string
42
- err := json.Unmarshal([]byte(ownerGroupsText), &ownerGroups)
43
- if err != nil {
44
- return diag.Errorf("couldn't parse owner groups %q", ownerGroupsText)
+ if ownerGroupsText != "" {
+ err := json.Unmarshal([]byte(ownerGroupsText), &ownerGroups)
+ if err != nil {
45
+ return diag.Errorf("couldn't parse owner groups %q", ownerGroupsText)
46
+ }
47
}
48
_ = rd.Set("owner_groups", ownerGroups)
49
0 commit comments