Skip to content

Commit 5f8440e

Browse files
authored
Merge branch 'main' into simonfaltum/completion-install-uninstall
2 parents a5c69d2 + 8d7324d commit 5f8440e

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

acceptance/workspace/jobs/create-error/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Auth type: Personal Access Token (pat)
88
Next steps:
99
- Verify you have the required permissions for this operation
1010
- Check your identity: databricks auth describe
11-
- Consider configuring a profile: databricks configure --profile <name>
11+
- Consider setting up a profile: databricks auth login --profile <name>
1212

1313
Exit code: 1

cmd/root/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type ErrNoWorkspaceProfiles struct {
2222
}
2323

2424
func (e ErrNoWorkspaceProfiles) Error() string {
25-
return e.path + " does not contain workspace profiles; please create one by running 'databricks configure'"
25+
return e.path + " does not contain workspace profiles; please create one by running 'databricks auth login'"
2626
}
2727

2828
type ErrNoAccountProfiles struct {

libs/auth/error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func EnrichAuthError(ctx context.Context, cfg *config.Config, err error) error {
107107

108108
// Nudge toward profiles when using env-var-based auth.
109109
if cfg.Profile == "" {
110-
fmt.Fprint(&b, "\n - Consider configuring a profile: databricks configure --profile <name>")
110+
fmt.Fprint(&b, "\n - Consider setting up a profile: databricks auth login --profile <name>")
111111
}
112112

113113
return fmt.Errorf("%w\n%s", err, b.String())
@@ -143,14 +143,14 @@ func writeReauthSteps(ctx context.Context, cfg *config.Config, b *strings.Builde
143143

144144
case AuthTypePat:
145145
if cfg.Profile != "" {
146-
fmt.Fprintf(b, "\n - Regenerate your access token or run: databricks configure --profile %s", cfg.Profile)
146+
fmt.Fprintf(b, "\n - Regenerate your access token or run: databricks auth login --profile %s", cfg.Profile)
147147
} else {
148148
fmt.Fprint(b, "\n - Regenerate your access token")
149149
}
150150

151151
case AuthTypeBasic:
152152
if cfg.Profile != "" {
153-
fmt.Fprintf(b, "\n - Check your username/password or run: databricks configure --profile %s", cfg.Profile)
153+
fmt.Fprintf(b, "\n - Check your username/password or run: databricks auth login --profile %s", cfg.Profile)
154154
} else {
155155
fmt.Fprint(b, "\n - Check your username and password")
156156
}

libs/auth/error_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func TestEnrichAuthError(t *testing.T) {
9999
"\nHost: https://my-workspace.cloud.databricks.com" +
100100
"\nAuth type: Personal Access Token (pat)" +
101101
"\n\nNext steps:" +
102-
"\n - Regenerate your access token or run: databricks configure --profile dev" +
102+
"\n - Regenerate your access token or run: databricks auth login --profile dev" +
103103
"\n - Check your identity: databricks auth describe --profile dev",
104104
},
105105
{
@@ -147,7 +147,7 @@ func TestEnrichAuthError(t *testing.T) {
147147
"\nHost: https://my-workspace.cloud.databricks.com" +
148148
"\nAuth type: Basic" +
149149
"\n\nNext steps:" +
150-
"\n - Check your username/password or run: databricks configure --profile basic-profile" +
150+
"\n - Check your username/password or run: databricks auth login --profile basic-profile" +
151151
"\n - Check your identity: databricks auth describe --profile basic-profile",
152152
},
153153
{
@@ -195,7 +195,7 @@ func TestEnrichAuthError(t *testing.T) {
195195
"\n\nNext steps:" +
196196
"\n - Regenerate your access token" +
197197
"\n - Check your identity: databricks auth describe" +
198-
"\n - Consider configuring a profile: databricks configure --profile <name>",
198+
"\n - Consider setting up a profile: databricks auth login --profile <name>",
199199
},
200200
{
201201
name: "403 without profile (env var auth)",
@@ -210,7 +210,7 @@ func TestEnrichAuthError(t *testing.T) {
210210
"\n\nNext steps:" +
211211
"\n - Verify you have the required permissions for this operation" +
212212
"\n - Check your identity: databricks auth describe" +
213-
"\n - Consider configuring a profile: databricks configure --profile <name>",
213+
"\n - Consider setting up a profile: databricks auth login --profile <name>",
214214
},
215215
{
216216
name: "401 with account host and no profile",
@@ -226,7 +226,7 @@ func TestEnrichAuthError(t *testing.T) {
226226
"\n\nNext steps:" +
227227
"\n - Re-authenticate: databricks auth login --host https://accounts.cloud.databricks.com --account-id abc123" +
228228
"\n - Check your identity: databricks auth describe" +
229-
"\n - Consider configuring a profile: databricks configure --profile <name>",
229+
"\n - Consider setting up a profile: databricks auth login --profile <name>",
230230
},
231231
{
232232
name: "401 with unified host includes workspace-id in login",
@@ -244,7 +244,7 @@ func TestEnrichAuthError(t *testing.T) {
244244
"\n\nNext steps:" +
245245
"\n - Re-authenticate: databricks auth login --host https://unified.cloud.databricks.com --account-id acc-123 --experimental-is-unified-host --workspace-id ws-456" +
246246
"\n - Check your identity: databricks auth describe" +
247-
"\n - Consider configuring a profile: databricks configure --profile <name>",
247+
"\n - Consider setting up a profile: databricks auth login --profile <name>",
248248
},
249249
}
250250

libs/databrickscfg/profile/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (f FileProfilerImpl) Get(ctx context.Context) (*config.File, error) {
5757
configFile, err := config.LoadFile(path)
5858
if errors.Is(err, fs.ErrNotExist) {
5959
// downstreams depend on ErrNoConfiguration. TODO: expose this error through SDK
60-
return nil, fmt.Errorf("%w at %s; please create one by running 'databricks configure'", ErrNoConfiguration, path)
60+
return nil, fmt.Errorf("%w at %s; please create one by running 'databricks auth login'", ErrNoConfiguration, path)
6161
} else if err != nil {
6262
return nil, err
6363
}

libs/template/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func loadHelpers(ctx context.Context) template.FuncMap {
9999
// Get smallest node type (follows Terraform's GetSmallestNodeType)
100100
"smallest_node_type": func() (string, error) {
101101
if w.Config.Host == "" {
102-
return "", errors.New("cannot determine target workspace, please first setup a configuration profile using 'databricks configure'")
102+
return "", errors.New("cannot determine target workspace, please first setup a configuration profile using 'databricks auth login'")
103103
}
104104
if w.Config.IsAzure() {
105105
return "Standard_D3_v2", nil
@@ -113,7 +113,7 @@ func loadHelpers(ctx context.Context) template.FuncMap {
113113
},
114114
"workspace_host": func() (string, error) {
115115
if w.Config.Host == "" {
116-
return "", errors.New("cannot determine target workspace, please first setup a configuration profile using 'databricks configure'")
116+
return "", errors.New("cannot determine target workspace, please first setup a configuration profile using 'databricks auth login'")
117117
}
118118
return w.Config.Host, nil
119119
},

0 commit comments

Comments
 (0)