@@ -198,32 +198,25 @@ func copyAttributesSorted(targetBody *hclwrite.Body, sourceAttrs map[string]*hcl
198
198
}
199
199
200
200
func processAllSpecs (body * hclwrite.Body , diskSizeGB hclwrite.Tokens ) {
201
- // Process specs that need diskSizeGB
202
201
specsWithDisk := []string {nElectableSpecs , nReadOnlySpecs , nAnalyticsSpecs }
203
202
for _ , spec := range specsWithDisk {
204
203
fillSpecOpt (body , spec , diskSizeGB )
205
204
}
206
- // Process specs without diskSizeGB
207
205
specsWithoutDisk := []string {nAutoScaling , nAnalyticsAutoScaling }
208
206
for _ , spec := range specsWithoutDisk {
209
207
fillSpecOpt (body , spec , nil )
210
208
}
211
209
}
212
210
213
211
func processConfigForDynamicBlock (configBlockb * hclwrite.Body , diskSizeGB hclwrite.Tokens ) * hclwrite.Body {
214
- // Create a new body with sorted attributes
215
212
newConfigBody := hclwrite .NewEmptyFile ().Body ()
216
-
217
- // Copy attributes in the expected order (priority, provider_name, region_name first)
218
213
attrs := configBlockb .Attributes ()
219
214
orderedAttrs := []string {nPriority , nProviderName , nRegionName }
220
215
for _ , attrName := range orderedAttrs {
221
216
if attr := attrs [attrName ]; attr != nil {
222
217
newConfigBody .SetAttributeRaw (attrName , attr .Expr ().BuildTokens (nil ))
223
218
}
224
219
}
225
-
226
- // Process spec blocks and convert them to attributes
227
220
for _ , block := range configBlockb .Blocks () {
228
221
blockType := block .Type ()
229
222
blockBody := hclwrite .NewEmptyFile ().Body ()
@@ -234,7 +227,6 @@ func processConfigForDynamicBlock(configBlockb *hclwrite.Body, diskSizeGB hclwri
234
227
}
235
228
newConfigBody .SetAttributeRaw (blockType , hcl .TokensObject (blockBody ))
236
229
}
237
-
238
230
return newConfigBody
239
231
}
240
232
0 commit comments