Skip to content

Commit b76e232

Browse files
authored
fix(provider): remove warning diag if CODER_WORKSPACE_OWNER_LOGIN_TYPE is not set (#311)
1 parent ceefe84 commit b76e232

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

provider/workspace_owner.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@ func workspaceOwnerDataSource() *schema.Resource {
5555
_ = rd.Set("session_token", os.Getenv("CODER_WORKSPACE_OWNER_SESSION_TOKEN"))
5656
_ = rd.Set("oidc_access_token", os.Getenv("CODER_WORKSPACE_OWNER_OIDC_ACCESS_TOKEN"))
5757

58-
if os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE") == "" {
59-
diags = append(diags, diag.Diagnostic{
60-
Severity: diag.Warning,
61-
Summary: "WARNING: The CODER_WORKSPACE_OWNER_LOGIN_TYPE env variable is not set",
62-
})
58+
if loginType := os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"); loginType != "" {
59+
_ = rd.Set("login_type", loginType)
6360
}
64-
_ = rd.Set("login_type", os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"))
6561

6662
return diags
6763
},

0 commit comments

Comments
 (0)