From 4a416b8962e7c21faacf0a7624dbe686a72e28f4 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 9 Jun 2026 16:55:22 +0200 Subject: [PATCH 1/3] Send zero-value photon/serverless/continuous/development for pipelines These optional boolean fields have meaningful false values, but the Go SDK omits them unless they are listed in ForceSendFields. As a result an explicit `photon = false` (or serverless/continuous/development) in the config was dropped from the create/update request and the platform applied its own default instead. Call SetForceSendFields for these fields in Create and Update so that a user-specified false value is sent to the platform. Co-authored-by: Denis Bilenko --- pipelines/resource_pipeline.go | 8 ++++++++ pipelines/resource_pipeline_test.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/pipelines/resource_pipeline.go b/pipelines/resource_pipeline.go index 65ff9ae879..c5ccbb8d7f 100644 --- a/pipelines/resource_pipeline.go +++ b/pipelines/resource_pipeline.go @@ -21,6 +21,12 @@ import ( // DefaultTimeout is the default amount of time that Terraform will wait when creating, updating and deleting pipelines. const DefaultTimeout = 20 * time.Minute +// booleanForceSendFields are optional boolean fields whose zero value (false) +// is meaningful and must be sent to the platform. Without ForceSendFields the +// Go SDK omits them, so an explicit `photon = false` (etc.) would be dropped +// and the platform would apply its own default instead. +var booleanForceSendFields = []string{"photon", "serverless", "continuous", "development"} + func adjustForceSendFields(clusterList *[]pipelines.PipelineCluster) { for i := range *clusterList { cluster := &((*clusterList)[i]) @@ -39,6 +45,7 @@ func Create(w *databricks.WorkspaceClient, ctx context.Context, d *schema.Resour var createPipelineRequest createPipelineRequestStruct common.DataToStructPointer(d, pipelineSchema, &createPipelineRequest) adjustForceSendFields(&createPipelineRequest.Clusters) + common.SetForceSendFields(&createPipelineRequest.CreatePipeline, d, booleanForceSendFields) createdPipeline, err := w.Pipelines.Create(ctx, createPipelineRequest.CreatePipeline) if err != nil { @@ -71,6 +78,7 @@ func Update(w *databricks.WorkspaceClient, ctx context.Context, d *schema.Resour common.DataToStructPointer(d, pipelineSchema, &updatePipelineRequest) updatePipelineRequest.EditPipeline.PipelineId = d.Id() adjustForceSendFields(&updatePipelineRequest.Clusters) + common.SetForceSendFields(&updatePipelineRequest.EditPipeline, d, booleanForceSendFields) err := w.Pipelines.Update(ctx, updatePipelineRequest.EditPipeline) if err != nil { return err diff --git a/pipelines/resource_pipeline_test.go b/pipelines/resource_pipeline_test.go index 7cd5c79cbc..6039f56853 100644 --- a/pipelines/resource_pipeline_test.go +++ b/pipelines/resource_pipeline_test.go @@ -47,6 +47,8 @@ var createRequest = pipelines.CreatePipeline{ }, Edition: "ADVANCED", Channel: "CURRENT", + // continuous = false is set explicitly in the HCL, so it is force-sent. + ForceSendFields: []string{"Continuous"}, } var updateRequest = pipelines.EditPipeline{ From cdbd3a0d49966f4e794418c07dd6d7ab36d96d48 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Sun, 14 Jun 2026 13:08:31 -0700 Subject: [PATCH 2/3] Add NEXT_CHANGELOG entry for pipeline zero-value bool fix Co-authored-by: Denis Bilenko --- NEXT_CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 004eb2efe5..32793907cc 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -8,6 +8,8 @@ ### Bug Fixes +* Fix `databricks_pipeline` so that `photon`, `serverless`, `continuous` and `development` set to `false` are sent in the create/update request. Previously these fields were silently dropped (Go SDK marshals the bool with `omitempty`), so the server applied its own default instead of the configured `false` ([#5806](https://github.com/databricks/terraform-provider-databricks/pull/5806)). + ### Documentation ### Exporter From bb97865ce2f4c8932f615d9e34c220011aef9372 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Sun, 14 Jun 2026 13:10:58 -0700 Subject: [PATCH 3/3] Tighten test comment and shorten changelog entry Co-authored-by: Denis Bilenko --- NEXT_CHANGELOG.md | 2 +- pipelines/resource_pipeline_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 32793907cc..6c8c134be1 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -8,7 +8,7 @@ ### Bug Fixes -* Fix `databricks_pipeline` so that `photon`, `serverless`, `continuous` and `development` set to `false` are sent in the create/update request. Previously these fields were silently dropped (Go SDK marshals the bool with `omitempty`), so the server applied its own default instead of the configured `false` ([#5806](https://github.com/databricks/terraform-provider-databricks/pull/5806)). +* Fix `databricks_pipeline` so that `photon`, `serverless`, `continuous` and `development` set to `false` are sent in the create/update request if specified ([#5806](https://github.com/databricks/terraform-provider-databricks/pull/5806)). ### Documentation diff --git a/pipelines/resource_pipeline_test.go b/pipelines/resource_pipeline_test.go index 6039f56853..57db98df3d 100644 --- a/pipelines/resource_pipeline_test.go +++ b/pipelines/resource_pipeline_test.go @@ -47,7 +47,7 @@ var createRequest = pipelines.CreatePipeline{ }, Edition: "ADVANCED", Channel: "CURRENT", - // continuous = false is set explicitly in the HCL, so it is force-sent. + // TestResourcePipelineCreate sets continuous = false in its HCL, so it is force-sent. ForceSendFields: []string{"Continuous"}, }