You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes a hard error that prevents any further execution if there is NOT a file called ~/.databrickscfg, regardless of the DATABRICKS_CONFIG_FILE setting.
## Changes
#629 introduced a change to autopopulate the host from .databrickscfg if
the user is logging back into a host they were previously using. This
did not respect the DATABRICKS_CONFIG_FILE env variable, causing the
flow to stop working for users with no .databrickscfg file in their home
directory.
This PR refactors all config file loading to go through one interface,
`databrickscfg.GetDatabricksCfg()`, and an auxiliary
`databrickscfg.GetDatabricksCfgPath()` to get the configured file path.
Closes#655.
## Tests
```
$ databricks auth login --profile abc
Error: open /Users/miles/.databrickscfg: no such file or directory
$ ./cli auth login --profile abc
Error: cannot load Databricks config file: open /Users/miles/.databrickscfg: no such file or directory
$ DATABRICKS_CONFIG_FILE=~/.databrickscfg.bak ./cli auth login --profile abc
Databricks Host: https://asdf
```
As part of this change #629 an explicit call to
databrickscfg.DefaultPath
is used rather than checking for the env varDATABRICKS_CONFIG_FILE
as percli/cmd/auth/profiles.go
Line 20 in 6b615cc
This causes a hard error that prevents any further execution if there is NOT a file called
~/.databrickscfg
, regardless of theDATABRICKS_CONFIG_FILE
setting.This is also explicitly used here:
cli/libs/databrickscfg/profiles.go
Line 109 in 6b615cc
Is there a better way to guard the use of this config default so that
DATABRICKS_CONFIG_FILE
is used if set regardless of which code path is run?The text was updated successfully, but these errors were encountered: