mirror of https://github.com/databricks/cli.git
Fix bug where the account or workspace client could be `nil` (#1020)
## Changes We didn't return the error upon creating a workspace or account client. If there is an error, it must always propagate up the stack. The result of this bug was that we were setting a `nil` account or workspace client, which in turn caused SIGSEGVs. Fixes #913. ## Tests Manually confirmed this fixes the linked issue. The CLI now correctly returns an error when the client cannot be constructed. The issue was reproducible using a `.databrickscfg` with a single, incorrectly configured profile.
This commit is contained in:
parent
833746cbdd
commit
deb062c489
|
@ -65,7 +65,7 @@ func accountClientOrPrompt(ctx context.Context, cfg *config.Config, allowPrompt
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
return a, nil
|
||||
return a, err
|
||||
}
|
||||
|
||||
func MustAccountClient(cmd *cobra.Command, args []string) error {
|
||||
|
@ -133,7 +133,7 @@ func workspaceClientOrPrompt(ctx context.Context, cfg *config.Config, allowPromp
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
return w, nil
|
||||
return w, err
|
||||
}
|
||||
|
||||
func MustWorkspaceClient(cmd *cobra.Command, args []string) error {
|
||||
|
|
Loading…
Reference in New Issue