Skip to content

Commit e62501a

Browse files
authored
Fix spurious plan diffs in model serving resources due to tag reordering (#5120)
## Changes <!-- Summary of your changes that are easy to understand --> Fixes #5119 The Databricks API returns tags as an ordered list, which caused Terraform to show spurious diffs when tags were returned in different orders, even though the key-value pairs remained unchanged. The fix is done by changing `tags` type to `TypeSet`, which is simpler than the original implementation. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant 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 - [x] has entry in `NEXT_CHANGELOG.md` file
1 parent abd4749 commit e62501a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
### Bug Fixes
1313

14+
* Fix spurious plan diffs in `databricks_model_serving` and `databricks_model_serving_provisioned_throughput` resources due to tag reordering ([#5120](https://github.com/databricks/terraform-provider-databricks/pull/5120))
15+
1416
### Documentation
1517

1618
### Exporter

serving/resource_model_serving.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ func ResourceModelServing() common.Resource {
290290
// route_optimized cannot be updated.
291291
common.CustomizeSchemaPath(m, "route_optimized").SetForceNew()
292292

293+
// Tags should have Set type
294+
m["tags"].Type = schema.TypeSet
295+
293296
m["serving_endpoint_id"] = &schema.Schema{
294297
Computed: true,
295298
Type: schema.TypeString,

serving/resource_model_serving_provisioned_throughput.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ func ResourceModelServingProvisionedThroughput() common.Resource {
5252
common.CustomizeSchemaPath(m, "ai_gateway", "guardrails", "input", "pii").SetOptional().SetComputed()
5353
common.CustomizeSchemaPath(m, "ai_gateway", "guardrails", "input", "pii", "behavior").SetOptional().SetComputed()
5454

55+
// Tags should have Set type
56+
m["tags"].Type = schema.TypeSet
57+
5558
m["serving_endpoint_id"] = &schema.Schema{
5659
Computed: true,
5760
Type: schema.TypeString,

0 commit comments

Comments
 (0)