Skip to content

Commit 2f3f734

Browse files
committed
feat: create a new diags variable
1 parent 210847d commit 2f3f734

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

provider/workspace_owner.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ func workspaceOwnerDataSource() *schema.Resource {
1515
return &schema.Resource{
1616
Description: "Use this data source to fetch information about the workspace owner.",
1717
ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
18+
diags := diag.Diagnostics{}
19+
1820
if idStr := os.Getenv("CODER_WORKSPACE_OWNER_ID"); idStr != "" {
1921
rd.SetId(idStr)
2022
} else {
@@ -54,7 +56,6 @@ func workspaceOwnerDataSource() *schema.Resource {
5456
_ = rd.Set("oidc_access_token", os.Getenv("CODER_WORKSPACE_OWNER_OIDC_ACCESS_TOKEN"))
5557

5658
if os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE") == "" {
57-
diags := req.Config.Get(ctx, &rd)
5859
diags = append(diags, diag.Diagnostic{
5960
Severity: diag.Warning,
6061
Summmary: "WARNING: The CODER_WORKSPACE_OWNER_LOGIN_TYPE env variable is not set"

0 commit comments

Comments
 (0)