Skip to content

Commit a0371a2

Browse files
authored
[Exporter] Add Ignore implementation for databricks_grants to fix issue with wrongly generated dependencies (#4661)
## Changes <!-- Summary of your changes that are easy to understand --> The lack of `Ignore` led to the situation when we added a `depends_on` on grant and grants list was empty, but the reference wasn't removed from `depends_on` list because we didn't have `Ignore` implementation. Resolves #4025 ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework
1 parent 7beaeb1 commit a0371a2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
### Exporter
1919

2020
* Correctly handle account-level identities when generating the code ([#4650](https://github.com/databricks/terraform-provider-databricks/pull/4650))
21+
* Add `Ignore` implementation for `databricks_grants` to fix issue with wrongly generated dependencies ([#4661](https://github.com/databricks/terraform-provider-databricks/pull/4650))
2122

2223
### Internal Changes

exporter/importables.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,10 @@ var resourcesMap map[string]importable = map[string]importable{
21102110
WorkspaceLevel: true,
21112111
Service: "uc-grants",
21122112
Import: importUcGrants,
2113+
Ignore: func(ic *importContext, r *resource) bool {
2114+
return (r.Data.Get("grant.#").(int) == 0)
2115+
},
2116+
21132117
Depends: []reference{
21142118
{Path: "catalog", Resource: "databricks_catalog"},
21152119
{Path: "schema", Resource: "databricks_schema"},

0 commit comments

Comments
 (0)