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

Add a warning when UC resource references or names contains capital letters #1763

Closed
shreyas-goenka opened this issue Sep 9, 2024 · 3 comments · Fixed by databricks/terraform-provider-databricks#4196
Assignees
Labels
DABs DABs related issues Enhancement New feature or request

Comments

@shreyas-goenka
Copy link
Contributor

Using a capital letter can cause a permanent drift in the state because the APIs are often case insensitive, but internally, UC resources are always lowercase.

For instance, in case of catalogs in a DLT pipeline, this can cause the pipelines to always be recreated and recomputed in DABs.

@shreyas-goenka shreyas-goenka added the DABs DABs related issues label Sep 9, 2024
@shreyas-goenka shreyas-goenka self-assigned this Sep 9, 2024
@shreyas-goenka shreyas-goenka added the Enhancement New feature or request label Sep 9, 2024
@shreyas-goenka
Copy link
Contributor Author

shreyas-goenka commented Sep 9, 2024

Alternately, we can start normalizing all UC resource names to lowercase on the client side and avoid the warning/overhead for the users altogether.

@andrewnester
Copy link
Contributor

I think we should instead just normalise it

@shreyas-goenka
Copy link
Contributor Author

shreyas-goenka commented Sep 9, 2024

It's also the option I prefer. We need to however:

  1. Compile a list of all applicable fields. It's going to be more than catalog for DLT pipelines. Eg: target for DLT.
  2. Sanity check with the owning (or UC) team that these fields will not become case-sensitive in the future.

github-merge-queue bot pushed a commit to databricks/terraform-provider-databricks that referenced this issue Nov 6, 2024
## Changes
Fixes databricks/cli#1763. During creation the
`catalog` name for a DLT pipeline is normalized to small case causing a
persistent drift.

## Tests
Manually with the following configuration:
```
resource "databricks_pipeline" "this" {
  name = "testing caps"
  catalog = "MaiN"
  library {
    notebook {
      path = "/a/b/c"
    }
  }
}
```

Before:
There'd be a persistent drift where terraform would try to convert
"MaiN" -> "main"

After:
No diff detected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DABs DABs related issues Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants