Skip to content

Commit

Permalink
Fix tf2pulumi renames
Browse files Browse the repository at this point in the history
This PR moves an invalid mapping in the
`pkg/tf2pulumi/convert/testdata/mappings/renames.json` to a valid mapping. You can see the
newly valid mapping take effect in the schema file:
`pkg/tf2pulumi/convert/testdata/schemas/renames.json`.

This PR exposes a bug where tf2pulumi doesn't properly propagate `MaxItems: 1`
information. The bug is shown in the changes in
`pkg/tf2pulumi/convert/testdata/renames/pcl/main.pp`.
  • Loading branch information
iwahbe committed Aug 14, 2024
1 parent 5ef404f commit 7d28415
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions pkg/tf2pulumi/convert/testdata/mappings/renames.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@
},
"a_resource": {
"name": "theResource",
"fields": {
"inner_string": {
"name": "theInnerString"
"element": {
"fields": {
"inner_string": {
"name": "theInnerString"
}
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/tf2pulumi/convert/testdata/renames/pcl/main.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource aResource "renames:index/index:resource" {
theNumber = 1
theResource = {
theInnerString = "hello"
innerString = "hello"
}
}
output someOutputA {
Expand Down Expand Up @@ -34,6 +34,6 @@
}
theNumber = 1
theResource = {
theInnerString = "hello"
innerString = "hello"
}
}
2 changes: 1 addition & 1 deletion pkg/tf2pulumi/convert/testdata/schemas/renames.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"renames:index/resourceTheResource:resourceTheResource": {
"properties": {
"innerString": {
"theInnerString": {
"type": "string"
}
},
Expand Down

0 comments on commit 7d28415

Please sign in to comment.