Skip to content

Commit 64015ca

Browse files
authored
refactor: let panic arise directly if the provider doesn't implement providers.StateStoreChunkSizeSetter (#37942)
1 parent cf047be commit 64015ca

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

internal/backend/pluggable/pluggable.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,8 @@ func (p *Pluggable) Configure(config cty.Value) tfdiags.Diagnostics {
135135

136136
// Negotiated chunk size is valid, so set it in the provider server
137137
// that will use the value for future RPCs to read/write state.
138-
if cs, ok := p.provider.(providers.StateStoreChunkSizeSetter); ok {
139-
cs.SetStateStoreChunkSize(p.typeName, int(chunkSize))
140-
} else {
141-
// TODO: Remove
142-
// I've put this here to try and fish for types of test setup that
143-
// use other things that should implement SetStateStoreChunkSize but
144-
// don't yet.
145-
panic("provider does not implement providers.StateStoreChunkSizeSetter interface. This is a bug in Terraform and should be reported.")
146-
}
138+
cs := p.provider.(providers.StateStoreChunkSizeSetter)
139+
cs.SetStateStoreChunkSize(p.typeName, int(chunkSize))
147140
log.Printf("[TRACE] Pluggable.Configure: negotiated a chunk size of %v when configuring state store %s",
148141
chunkSize,
149142
p.typeName,

0 commit comments

Comments
 (0)