Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fb69196

Browse files
committedSep 11, 2024·
feat: set empty string as the default value for the login type
1 parent 6f96982 commit fb69196

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

‎provider/workspace_owner.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ func workspaceOwnerDataSource() *schema.Resource {
5353
_ = rd.Set("session_token", os.Getenv("CODER_WORKSPACE_OWNER_SESSION_TOKEN"))
5454
_ = rd.Set("oidc_access_token", os.Getenv("CODER_WORKSPACE_OWNER_OIDC_ACCESS_TOKEN"))
5555

56-
if login_type := os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"); login_type != "" {
57-
_ = rd.Set("login_type", login_type)
58-
} else {
59-
_ = rd.Set("login_type", "none")
60-
}
56+
_ = rd.Set("login_type", os.Getenv("CODER_WORKSPACE_OWNER_LOGIN_TYPE"))
6157

6258
return nil
6359
},

‎provider/workspace_owner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestWorkspaceOwnerDatasource(t *testing.T) {
115115
assert.Empty(t, attrs["groups.0"])
116116
assert.Empty(t, attrs["session_token"])
117117
assert.Empty(t, attrs["oidc_access_token"])
118-
assert.Equal(t, "none", attrs["login_type"])
118+
assert.Empty(t, attrs["login_type"])
119119
return nil
120120
},
121121
}},

0 commit comments

Comments
 (0)
Please sign in to comment.