databricks-cli/cmd/root
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
..
auth.go Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
auth_options.go Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
auth_options_test.go Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
auth_test.go Run environment related tests in a pristine environment (#769) 2023-09-12 13:28:53 +00:00
bundle.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
bundle_test.go Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00
io.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
logger.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
progress_logger.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
progress_logger_test.go Remove dependency on global state for the root command (#606) 2023-07-26 11:17:09 +00:00
root.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
user_agent.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
user_agent_command.go Move code for including command name in user agent (#203) 2023-02-15 10:33:35 +01:00
user_agent_command_test.go Move code for including command name in user agent (#203) 2023-02-15 10:33:35 +01:00
user_agent_upstream.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
user_agent_upstream_test.go Let caller set BRICKS_UPSTREAM for user agent (#196) 2023-02-03 17:05:58 +01:00