Skip to content

Commit 0e69acb

Browse files
authored
Fixed phantom cluster blocks in databricks_pipeline (#1508)
Current problem reported in #1401 is caused by the behaviour of the complex data types inside the blocks that use the `slice_set` as a type - when we make changes the phantom blocks are generated in addition to required changes. Adding a custom hash function didn't help. This PR attempts to fix that issue other way - by changing the type of `cluster` blocks from the `TypeSet` to the `TypeList`. This approach, besides fixing the original issue will also help with decreasing the amount of plan changes when making changes in the `cluster` block. The side effect of this change is that when upgrading to a new version, Terraform will show changes in the DLT pipeline resource even if no actual changes were made in the code - this is a result of changing the order of the `cluster` blocks
1 parent 6a5f1c7 commit 0e69acb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pipelines/acceptance/pipeline_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func TestAccPipelineResource_CreatePipeline(t *testing.T) {
9595

9696
func TestAccAwsPipelineResource_CreatePipeline(t *testing.T) {
9797
if cloud, ok := os.LookupEnv("CLOUD_ENV"); !ok || cloud != "aws" {
98-
t.Skip("Test is only for CLOUD_ENV=AWS")
98+
t.Skip("Test is only for CLOUD_ENV=aws")
9999
}
100100
acceptance.Test(t, []acceptance.Step{
101101
{

pipelines/resource_pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type PipelineSpec struct {
6565
Name string `json:"name,omitempty"`
6666
Storage string `json:"storage,omitempty" tf:"force_new"`
6767
Configuration map[string]string `json:"configuration,omitempty"`
68-
Clusters []pipelineCluster `json:"clusters,omitempty" tf:"slice_set,alias:cluster"`
68+
Clusters []pipelineCluster `json:"clusters,omitempty" tf:"alias:cluster"`
6969
Libraries []PipelineLibrary `json:"libraries,omitempty" tf:"slice_set,alias:library"`
7070
Filters *filters `json:"filters,omitempty"`
7171
Continuous bool `json:"continuous,omitempty"`

0 commit comments

Comments
 (0)