Skip to content

Commit 210847d

Browse files
committed
feat: add a warning when the CODER_WORKSPACE_OWNER_LOGIN_TYPE is not set
1 parent 1e4b8fb commit 210847d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

provider/workspace_owner.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ func workspaceOwnerDataSource() *schema.Resource {
5454
_ = rd.Set("oidc_access_token", os.Getenv("CODER_WORKSPACE_OWNER_OIDC_ACCESS_TOKEN"))
5555

5656
if os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE") == "" {
57-
diag.Warn("The CODER_WORKSPACE_OWNER_LOGIN_TYPE env variable is not set")
57+
diags := req.Config.Get(ctx, &rd)
58+
diags = append(diags, diag.Diagnostic{
59+
Severity: diag.Warning,
60+
Summmary: "WARNING: The CODER_WORKSPACE_OWNER_LOGIN_TYPE env variable is not set"
61+
},
5862
}
5963
_ = rd.Set("login_type", os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"))
6064

61-
return nil
65+
return diags
6266
},
6367
Schema: map[string]*schema.Schema{
6468
"id": {

0 commit comments

Comments
 (0)