Skip to content

Commit ee217c4

Browse files
committed
convert to string
1 parent f046a3a commit ee217c4

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

provider/workspace.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,9 @@ func workspaceDataSource() *schema.Resource {
145145
"If a valid token cannot be obtained, this value will be an empty string.",
146146
},
147147
"owner_groups": {
148-
Type: schema.TypeList,
149-
Elem: &schema.Schema{
150-
Type: schema.TypeString,
151-
},
148+
Type: schema.TypeString,
152149
Computed: true,
153-
Description: "List of groups the workspace owner belongs to. ",
150+
Description: "Comma separated list of groups the workspace owner belongs to.",
154151
},
155152
"id": {
156153
Type: schema.TypeString,

provider/workspace_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestWorkspace(t *testing.T) {
1616
t.Setenv("CODER_WORKSPACE_OWNER_NAME", "Mr Owner")
1717
t.Setenv("CODER_WORKSPACE_OWNER_EMAIL", "[email protected]")
1818
t.Setenv("CODER_WORKSPACE_OWNER_SESSION_TOKEN", "abc123")
19-
t.Setenv("CODER_WORKSPACE_OWNER_GROUPS", "[ \"group1\", \"group2\" ]")
19+
t.Setenv("CODER_WORKSPACE_OWNER_GROUPS", "group1,group2")
2020
t.Setenv("CODER_WORKSPACE_TEMPLATE_ID", "templateID")
2121
t.Setenv("CODER_WORKSPACE_TEMPLATE_NAME", "template123")
2222
t.Setenv("CODER_WORKSPACE_TEMPLATE_VERSION", "v1.2.3")
@@ -48,7 +48,7 @@ func TestWorkspace(t *testing.T) {
4848
require.Equal(t, "Mr Owner", attribs["owner_name"])
4949
require.Equal(t, "[email protected]", attribs["owner_email"])
5050
require.Equal(t, "abc123", attribs["owner_session_token"])
51-
require.Equal(t, "[ \"group1\", \"group2\" ]", attribs["owner_groups"])
51+
require.Equal(t, "group1,group2", attribs["owner_groups"])
5252
require.Equal(t, "templateID", attribs["template_id"])
5353
require.Equal(t, "template123", attribs["template_name"])
5454
require.Equal(t, "v1.2.3", attribs["template_version"])
@@ -82,7 +82,7 @@ func TestWorkspace(t *testing.T) {
8282
require.Equal(t, "owner123", attribs["owner"])
8383
require.Equal(t, "Mr Owner", attribs["owner_name"])
8484
require.Equal(t, "[email protected]", attribs["owner_email"])
85-
require.Equal(t, "[ \"group1\", \"group2\" ]", attribs["owner_groups"])
85+
require.Equal(t, "group1,group2", attribs["owner_groups"])
8686
require.Equal(t, "templateID", attribs["template_id"])
8787
require.Equal(t, "template123", attribs["template_name"])
8888
require.Equal(t, "v1.2.3", attribs["template_version"])

0 commit comments

Comments
 (0)