databricks-cli/cmd
Pieter Noordhuis d4be40520c
Resolve configuration before performing verification (#890)
## Changes

If a bundle configuration specifies a workspace host, and the user
specifies a profile to use, we perform a check to confirm that the
workspace host in the bundle configuration and the workspace host from
the profile are identical. If they are not, we return an error. The
check was introduced in #571.

Previously, the code included an assumption that the client
configuration was already loaded from the environment prior to
performing the check. This was not the case, and as such if the user
intended to use a non-default path to `.databrickscfg`, this path was
not used when performing the check.

The fix does the following:
* Resolve the configuration prior to performing the check.
* Don't treat the configuration file not existing as an error.
* Add unit tests.

Fixes #884.

## Tests

Unit tests and manual confirmation.
2023-10-20 13:10:31 +00:00
..
account Fixed requiring positional arguments for API URL parameters (#878) 2023-10-19 14:19:17 +00:00
api Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
auth Use profile information when getting a token using the CLI (#855) 2023-10-11 11:12:18 +00:00
bundle Improve the output of the `databricks bundle init` command (#795) 2023-10-19 07:08:36 +00:00
configure Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
fs Remove dependency on global state for remaining commands (#613) 2023-07-27 10:03:08 +00:00
root Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00
sync Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
version Added description for version command (#737) 2023-09-06 08:41:47 +00:00
workspace Fixed requiring positional arguments for API URL parameters (#878) 2023-10-19 14:19:17 +00:00
cmd.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00