-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Tolerate invalid keys in
databricks_workspace_conf
(#4102)
## Changes Occasionally, support for configuration keys is removed from the GetStatus/SetStatus APIs used to manage workspace configuration. When this happens, users who depended on those keys are in a bad state. The provider queries for the values for each configuration by key in the Terraform state, but those keys no longer exist. To work around this, this PR makes `databricks_workspace_conf` resilient to keys being removed. On the read path, the provider queries for the status of all keys in state. If any key is no longer valid, it is removed from the request and the request is retried. Setting the value for invalid configuration keys is not supported. When removing an unsupported configuration key, the provider resets the key to an original state (`false` or `""`). Failures to reset invalid keys are ignored, both on the update path (removing an unsupported key from the conf) and on the delete path (removing the `databricks_workspace_conf` resource altogether). ## Tests Integration tests verify that the new SafeGetStatus and SafeSetStatus methods work with invalid keys as expected. On the read side, they are ignored, and on the write side, they are ignored if marked for removal. - [ ] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] relevant acceptance tests are passing - [ ] using Go SDK
- Loading branch information
Showing
2 changed files
with
130 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters