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

[ISSUE] Issue with databricks_system_schema resource #4066

Open
Waiwait opened this issue Oct 2, 2024 · 1 comment
Open

[ISSUE] Issue with databricks_system_schema resource #4066

Waiwait opened this issue Oct 2, 2024 · 1 comment

Comments

@Waiwait
Copy link

Waiwait commented Oct 2, 2024

Configuration

databricks_system_schema resource passes silently when a schema has been disabled outside of terraform. This was discovered when we switched the metastore for a workspace and then dependent grants on the system_schema started failing after not finding the schema.

Expected Behavior

Terraform correctly recognises that the schema has been disabled outside of the state and acts appropriately.

Actual Behavior

Terraform silently passes, assuming that the schema is still enabled.

Steps to Reproduce

Terraform and provider versions

terraform-provider-databricks=1.49.0
terraform=v1.55.0

Is it a regression?

Debug Output

Important Factoids

Would you like to implement a fix?

I think this is caused by the Read function simply returning nil at the end of the for loop if no appropriate schema is found. This would be fixed by adding d.SetId("") to this, so that on the next run, it'll force a Create call. Happy to implement, just wanted to make sure this was the right approach.

@alexott
Copy link
Contributor

alexott commented Oct 3, 2024

yes, we're using similar approach in other resources, like, library: https://github.com/databricks/terraform-provider-databricks/blob/main/clusters/resource_library.go#L86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants