Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporter: don't emit databricks_permissions for /Shared directory #2288

Merged
merged 1 commit into from
May 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion exporter/importables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ var resourcesMap map[string]importable = map[string]importable{
})
}

// TODO: it's not completely correct condition - we need to make emit smarter - emit only if permissions are different from their parent's permission.
if ic.meAdmin {
ic.Emit(&resource{
Resource: "databricks_directory",
Expand Down Expand Up @@ -1677,6 +1678,7 @@ var resourcesMap map[string]importable = map[string]importable{
if strings.HasPrefix(directory.Path, "/Repos") {
continue
}
// TODO: don't emit directories for deleted users/SPs (how to identify them?)
ic.Emit(&resource{
Resource: "databricks_directory",
ID: directory.Path,
Expand All @@ -1693,7 +1695,8 @@ var resourcesMap map[string]importable = map[string]importable{
splits := strings.Split(r.Name, "_")
directoryId := splits[len(splits)-1]

if ic.meAdmin {
// Existing permissions API doesn't allow to set permissions for
if ic.meAdmin && r.ID != "/Shared" {
alexott marked this conversation as resolved.
Show resolved Hide resolved
ic.Emit(&resource{
Resource: "databricks_permissions",
ID: fmt.Sprintf("/directories/%s", directoryId),
Expand Down