Skip to content

Commit

Permalink
fix(provider): remove warning diag if CODER_WORKSPACE_OWNER_LOGIN_TYP…
Browse files Browse the repository at this point in the history
…E is not set (#311)
  • Loading branch information
johnstcn authored Nov 28, 2024
1 parent ceefe84 commit b76e232
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions provider/workspace_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ func workspaceOwnerDataSource() *schema.Resource {
_ = rd.Set("session_token", os.Getenv("CODER_WORKSPACE_OWNER_SESSION_TOKEN"))
_ = rd.Set("oidc_access_token", os.Getenv("CODER_WORKSPACE_OWNER_OIDC_ACCESS_TOKEN"))

if os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE") == "" {
diags = append(diags, diag.Diagnostic{
Severity: diag.Warning,
Summary: "WARNING: The CODER_WORKSPACE_OWNER_LOGIN_TYPE env variable is not set",
})
if loginType := os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"); loginType != "" {
_ = rd.Set("login_type", loginType)
}
_ = rd.Set("login_type", os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"))

return diags
},
Expand Down

0 comments on commit b76e232

Please sign in to comment.