Skip to content

Commit 8a263dc

Browse files
authored
fix: set owner name and email to "default"
Closes coder/modules#162 When the terraform plan is run, the `data.coder_workspace.me.owner_email` and `data.coder_workspace.me.owner_name` fields are blank, which causes the template build to fail. This should resolve the issue by setting those entries to a non-empty string.
1 parent f3a205c commit 8a263dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

provider/workspace.go

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ func workspaceDataSource() *schema.Resource {
3535
_ = rd.Set("owner", owner)
3636

3737
ownerEmail := os.Getenv("CODER_WORKSPACE_OWNER_EMAIL")
38+
if ownerEmail == "" {
39+
ownerEmail = "default"
40+
}
3841
_ = rd.Set("owner_email", ownerEmail)
3942

4043
ownerGroupsText := os.Getenv("CODER_WORKSPACE_OWNER_GROUPS")
@@ -48,6 +51,9 @@ func workspaceDataSource() *schema.Resource {
4851
_ = rd.Set("owner_groups", ownerGroups)
4952

5053
ownerName := os.Getenv("CODER_WORKSPACE_OWNER_NAME")
54+
if ownerName == "" {
55+
ownerName = "default"
56+
}
5157
_ = rd.Set("owner_name", ownerName)
5258

5359
ownerID := os.Getenv("CODER_WORKSPACE_OWNER_ID")

0 commit comments

Comments
 (0)