terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[Fix] Fix drift in `databricks_cluster` when `is_single_node` is set to `true`

Open ashenm opened this issue 10 months ago • 6 comments

Changes

Fixes #4360

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

In addition to the unit tests, deployed provider locally with following resource definition and verified diff

resource "databricks_cluster" "single_node" {
  spark_version      = "15.4.x-scala2.12"
  single_user_name   = "[email protected]"
  runtime_engine     = "STANDARD"
  node_type_id       = "r5.large"
  kind               = "CLASSIC_PREVIEW"
  is_single_node     = true
  data_security_mode = "SINGLE_USER"
  cluster_name       = upper("demo-single-node")

  custom_tags = {
    "owner" = "ashenm"
  }
  autotermination_minutes = 10
}

ashenm avatar Jan 17 '25 16:01 ashenm

@alexott please take a stab at it when u get a slot

ashenm avatar Jan 17 '25 16:01 ashenm

Please add tests for it - we have example of test for CustomizeDiff in resource_sql_table

alexott avatar Jan 17 '25 16:01 alexott

@mgyucht given the work on porting clusters to the plugin framework - do we need this PR?

alexott avatar Jan 20 '25 09:01 alexott

That work may take a bit longer than we thought to finish, so I'm OK merging incremental improvements like this.

mgyucht avatar Jan 20 '25 14:01 mgyucht

@alexott @mgyucht whenever y'all have a slot please take a stab

ashenm avatar Jan 28 '25 06:01 ashenm

There is still a drift in spark_conf

alexott avatar Aug 05 '25 09:08 alexott

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger: go/deco-tests-run/terraform

Inputs:

  • PR number: 4416
  • Commit SHA: 5e148173002b1734a528d05f8da889ee7ac23049

Checks will be approved automatically on success.

github-actions[bot] avatar Aug 18 '25 11:08 github-actions[bot]