databricks-cli/bundle/config
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
..
interpolation Use clearer error message when no interpolation value is found. (#764) 2023-09-11 15:23:25 +00:00
mutator Support Unity Catalog Registered Models in bundles (#846) 2023-10-16 15:32:49 +00:00
paths Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
resources Support Unity Catalog Registered Models in bundles (#846) 2023-10-16 15:32:49 +00:00
testdata First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
variable Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
artifact.go Mark artifacts properties as optional (#834) 2023-10-03 13:59:28 +00:00
bundle.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
experimental.go Make a notebook wrapper for Python wheel tasks optional (#797) 2023-09-26 14:32:20 +00:00
git.go Add validation for Git settings in bundles (#578) 2023-07-30 12:44:33 +00:00
lock.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
lock_test.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
resources.go Support Unity Catalog Registered Models in bundles (#846) 2023-10-16 15:32:49 +00:00
resources_test.go Support Unity Catalog Registered Models in bundles (#846) 2023-10-16 15:32:49 +00:00
root.go Allow target overrides for sync section (#856) 2023-10-10 15:18:18 +00:00
root_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
sync.go Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
target.go Allow target overrides for sync section (#856) 2023-10-10 15:18:18 +00:00
workspace.go Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00
workspace_test.go Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00