Skip to content

Commit 993fae3

Browse files
authored
direct: secret_scopes: set default for scope_backend_type to prevent recreate (#4834)
## Why Without this setting configurations that don't set scope_backend_type experience permanent drift with recreation of secret scopes. ## Tests New invariant test config without this field. The invariant/no_drift already catches this with the right config.
1 parent 9ded3b0 commit 993fae3

8 files changed

Lines changed: 17 additions & 3 deletions

File tree

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* engine/direct: Fix drift in grants resource due to privilege reordering ([#4794](https://github.com/databricks/cli/pull/4794))
1111
* engine/direct: Fix 400 error when deploying grants with ALL_PRIVILEGES ([#4801](https://github.com/databricks/cli/pull/4801))
1212
* Deduplicate grant entries with duplicate principals or privileges during initialization ([#4801](https://github.com/databricks/cli/pull/4801))
13+
* engine/direct: Fix unwanted recreation of secret scopes when scope_backend_type is not set ([#4834](https://github.com/databricks/cli/pull/4834))
1314

1415
### Dependency updates
1516

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bundle:
2+
name: test-bundle-$UNIQUE_NAME
3+
4+
resources:
5+
secret_scopes:
6+
foo:
7+
name: test-scope-$UNIQUE_NAME

acceptance/bundle/invariant/continue_293/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/migrate/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/migrate/test.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ EnvMatrixExclude.no_external_location = ["INPUT_CONFIG=external_location.yml.tmp
44

55
# Unexpected action='create' for resources.secret_scopes.foo.permissions
66
EnvMatrixExclude.no_secret_scope = ["INPUT_CONFIG=secret_scope.yml.tmpl"]
7+
EnvMatrixExclude.no_secret_scope2 = ["INPUT_CONFIG=secret_scope_default_backend_type.yml.tmpl"]
78

89
# Cross-resource permission references (e.g. ${resources.jobs.job_b.permissions[0].level})
910
# don't work in terraform mode: the terraform interpolator converts the path to

acceptance/bundle/invariant/no_drift/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/test.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ EnvMatrix.INPUT_CONFIG = [
4848
"schema_grant_ref.yml.tmpl",
4949
"schema_with_grants.yml.tmpl",
5050
"secret_scope.yml.tmpl",
51+
"secret_scope_default_backend_type.yml.tmpl",
5152
"synced_database_table.yml.tmpl",
5253
"volume.yml.tmpl",
5354
]

bundle/direct/dresources/resources.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ resources:
381381
- field: compute_size
382382

383383
secret_scopes:
384+
backend_defaults:
385+
# The Secrets API defaults scope_backend_type to DATABRICKS when not specified.
386+
- field: scope_backend_type
387+
values: ["DATABRICKS"]
384388
recreate_on_changes:
385389
- field: scope
386390
reason: immutable

0 commit comments

Comments
 (0)