Skip to content

Commit d06a3c0

Browse files
committed
Stop connecting sources and warehouses by default
1 parent 799cdc5 commit d06a3c0

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
1212
github.com/hashicorp/terraform-plugin-go v0.23.0
1313
github.com/hashicorp/terraform-plugin-testing v1.10.0
14-
github.com/segmentio/public-api-sdk-go v0.0.0-20231114153454-3be55fde5c99
14+
github.com/segmentio/public-api-sdk-go v0.0.0-20240819211447-e2f7f9318028
1515
gotest.tools/gotestsum v1.12.0
1616
)
1717

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3V
187187
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
188188
github.com/segmentio/public-api-sdk-go v0.0.0-20231114153454-3be55fde5c99 h1:55dfJRsEeZLLFln+0gQ1pNZvalFMyeMV9nTPQwShkok=
189189
github.com/segmentio/public-api-sdk-go v0.0.0-20231114153454-3be55fde5c99/go.mod h1:1mLoKkR7t90unwNx7qx9PicO3AX5NflFD7ny3TvLExU=
190+
github.com/segmentio/public-api-sdk-go v0.0.0-20240819211447-e2f7f9318028 h1:mY+y1F+uVH9D2rGZDzrJf8fNaoGAWXMKNz857VYpc3k=
191+
github.com/segmentio/public-api-sdk-go v0.0.0-20240819211447-e2f7f9318028/go.mod h1:yKkoPfcOkkYjiZQj4lRWxji0Qwc6ncNEf7wCfywochY=
190192
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
191193
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
192194
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=

internal/provider/source_resource.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,14 @@ func (r *sourceResource) Create(ctx context.Context, req resource.CreateRequest,
276276
return
277277
}
278278

279+
disconnectAllWarehouses := true
280+
279281
out, body, err := r.client.SourcesAPI.CreateSource(r.authContext).CreateSourceV1Input(api.CreateSourceV1Input{
280-
Slug: plan.Slug.ValueString(),
281-
Enabled: plan.Enabled.ValueBool(),
282-
MetadataId: metadataID,
283-
Settings: settings,
282+
Slug: plan.Slug.ValueString(),
283+
Enabled: plan.Enabled.ValueBool(),
284+
MetadataId: metadataID,
285+
Settings: settings,
286+
DisconnectAllWarehouses: &disconnectAllWarehouses,
284287
}).Execute()
285288
if body != nil {
286289
defer body.Body.Close()

internal/provider/warehouse_resource.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,14 @@ func (r *warehouseResource) Create(ctx context.Context, req resource.CreateReque
219219
name = nil
220220
}
221221

222+
disconnectAllSources := true
223+
222224
out, body, err := r.client.WarehousesAPI.CreateWarehouse(r.authContext).CreateWarehouseV1Input(api.CreateWarehouseV1Input{
223-
Enabled: plan.Enabled.ValueBoolPointer(),
224-
MetadataId: metadataID,
225-
Settings: settings,
226-
Name: name,
225+
Enabled: plan.Enabled.ValueBoolPointer(),
226+
MetadataId: metadataID,
227+
Settings: settings,
228+
Name: name,
229+
DisconnectAllSources: &disconnectAllSources,
227230
}).Execute()
228231
if body != nil {
229232
defer body.Body.Close()

0 commit comments

Comments
 (0)