-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exporter: fix generation of names for
databricks_library
resources
Internally, exporter uses following resource ID for `databricks_library`: `<cluster_id>/<type>:coordinate` (i.e., `0426-122546-8xi8q5o3/pypi:chispa`). When generating final name of the resource, this name is normalized, and checked if it's starting with a number, as Terraform doesn't allow identifiers to start with a number. If the final name starts with number, then the artificial final name is generated consisting in form of `r<first 12 digits of MD5 of the original name>`. This leads to generation of duplicate resources in case if cluster ID started with a number, and the same library was attached to the cluster multiple times, having only difference in the character case, like, `Chispa` and `chispa` (our clusters UI allows that). This PR fixes this issue with following changes: * add `lib_` prefix to the library name together with first 8 numbers of the MD5 of library ID * when generating resource name in form of `r<first 12 digits of MD5 of the original name>`, calculate MD5 of the original string, not the lower-cased form
- Loading branch information
Showing
4 changed files
with
13 additions
and
5 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
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