Fix `databricks configure` if new profile is specified (#1030)

## Changes

The code included the to-be-created profile in the configuration and
that triggered the SDK to try and load it. Instead, we must use the
specified host and token directly.

## Tests

Manually. More integration test coverage tbd.
This commit is contained in:
Pieter Noordhuis 2023-11-30 10:51:52 +01:00 committed by GitHub
parent 65458cbde6
commit 4a228e6f12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,11 @@ func configureInteractive(cmd *cobra.Command, flags *configureFlags, cfg *config
// Ask user to specify a cluster if not already set.
if flags.ConfigureCluster && cfg.ClusterID == "" {
w, err := databricks.NewWorkspaceClient((*databricks.Config)(cfg))
// Create workspace client with configuration without the profile name set.
w, err := databricks.NewWorkspaceClient(&databricks.Config{
Host: cfg.Host,
Token: cfg.Token,
})
if err != nil {
return err
}