Skip to content

Commit adcc804

Browse files
committed
[Internal] Refactor WorkspaceId to WorkspaceID in config
1 parent 67d6a63 commit adcc804

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

account_functions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (c *AccountClient) GetWorkspaceClient(ws provisioning.Workspace) (*Workspac
3636
return nil, err
3737
}
3838
cfg.AzureResourceID = ws.AzureResourceId()
39-
cfg.WorkspaceId = fmt.Sprintf("%d", ws.WorkspaceId)
39+
cfg.WorkspaceID = fmt.Sprintf("%d", ws.WorkspaceId)
4040
w, err := NewWorkspaceClient((*Config)(cfg))
4141
if err != nil {
4242
return nil, err

config/cli_token_source.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func buildCliCommand(cliPath string, cfg *Config) []string {
5454
if cfg.AccountID != "" {
5555
cmd = append(cmd, "--account-id", cfg.AccountID)
5656
}
57-
if cfg.WorkspaceId != "" {
58-
cmd = append(cmd, "--workspace-id", cfg.WorkspaceId)
57+
if cfg.WorkspaceID != "" {
58+
cmd = append(cmd, "--workspace-id", cfg.WorkspaceID)
5959
}
6060
case AccountHost:
6161
cmd = append(cmd, "--account-id", cfg.AccountID)

config/cli_token_source_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestBuildCliCommand(t *testing.T) {
156156
Host: unifiedHost,
157157
Experimental_IsUnifiedHost: true,
158158
AccountID: accountID,
159-
WorkspaceId: workspaceID,
159+
WorkspaceID: workspaceID,
160160
},
161161
wantCmd: []string{cliPath, "auth", "token", "--host", unifiedHost, "--experimental-is-unified-host", "--account-id", accountID, "--workspace-id", workspaceID},
162162
},
@@ -174,7 +174,7 @@ func TestBuildCliCommand(t *testing.T) {
174174
cfg: &Config{
175175
Host: unifiedHost,
176176
Experimental_IsUnifiedHost: true,
177-
WorkspaceId: workspaceID,
177+
WorkspaceID: workspaceID,
178178
},
179179
wantCmd: []string{cliPath, "auth", "token", "--host", unifiedHost, "--experimental-is-unified-host", "--workspace-id", workspaceID},
180180
},

config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ type Config struct {
8686
AccountID string `name:"account_id" env:"DATABRICKS_ACCOUNT_ID"`
8787

8888
// Databricks Workspace ID for Workspace clients when working with unified hosts
89-
WorkspaceId string `name:"workspace_id" env:"DATABRICKS_WORKSPACE_ID"`
89+
WorkspaceID string `name:"workspace_id" env:"DATABRICKS_WORKSPACE_ID"`
9090

9191
Token string `name:"token" env:"DATABRICKS_TOKEN" auth:"pat,sensitive"`
9292
Username string `name:"username" env:"DATABRICKS_USERNAME" auth:"basic"`
@@ -407,7 +407,7 @@ func (c *Config) ConfigType() ConfigType {
407407
// All unified host configs must have an account ID
408408
return InvalidConfig
409409
}
410-
if c.WorkspaceId != "" {
410+
if c.WorkspaceID != "" {
411411
return WorkspaceConfig
412412
}
413413
return AccountConfig

0 commit comments

Comments
 (0)