Skip to content

Commit a80db24

Browse files
committed
free cluster if providerName == "TENANT"
1 parent 48eb5d0 commit a80db24

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

internal/convert/clu2adv.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ func convertResource(block *hclwrite.Block) (bool, error) {
6969
}
7070

7171
func isFreeTierCluster(resourceb *hclwrite.Body) bool {
72-
d, _ := getDynamicBlock(resourceb, nRepSpecs, true)
73-
return resourceb.FirstMatchingBlock(nRepSpecs, nil) == nil && !d.IsPresent()
72+
providerName, _ := hcl.GetAttrString(resourceb.GetAttribute(nProviderName))
73+
return providerName == nTenant
7474
}
7575

7676
func convertDataSource(block *hclwrite.Block) bool {

internal/convert/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ const (
8080
nSpec = "spec"
8181
nFailIndexKeyTooLong = "fail_index_key_too_long"
8282
nDefaultReadConcern = "default_read_concern"
83+
nTenant = "TENANT"
8384
)

internal/convert/testdata/adv2v2/errors.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"configuration_file_error": "failed to parse Terraform config file",
33
"replication_specs_missing_region_configs": "replication_specs must have at least one region_configs",
4-
"missing_replication_specs": "must have at least one replication_specs",
54
"dynamic_unsupported_tag": "dynamic blocks are not supported for advanced_configuration",
65
"dynamic_regions_config_invalid_multiple_blocks": "dynamic block must be the only block",
76
"dynamic_replication_specs_invalid_multiple_blocks": "dynamic block must be the only block",

internal/convert/testdata/adv2v2/missing_replication_specs.in.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)