Skip to content

Commit

Permalink
Clarify workaround conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Oct 29, 2024
1 parent 2ee1a9a commit 05c8368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/tfbridge/typechecker/typechecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ func (v *TypeChecker) validatePropertyValue(
switch typeSpec.Type {
case "boolean":
// Check for strings that are values "true" or "false".
// These are handled as booleans in the bridge, so they should be skipped by the type checker.
//TODO: Remove the boolString condition when https://github.com/pulumi/pulumi-terraform-bridge/issues/2520
// is resolved. This is a workaround for the config encoding not honoring type overrides.
var boolString bool
if propertyValue.IsString() {
if propertyValue.StringValue() == "true" || propertyValue.StringValue() == "false" {
Expand Down
3 changes: 3 additions & 0 deletions pkg/tfbridge/typechecker/typechecker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,9 @@ func TestValidateConfigType(t *testing.T) {
}),
},
{
//TODO: Remove this test when https://github.com/pulumi/pulumi-terraform-bridge/issues/2520 is resolved.
// This tests a workaround path to keep the type checker from tripping on missing functionality in the
// config encoding and will fail once that is fixed.
name: "allows_bool_strings",
inputName: "skipMetadataApiCheck",
input: resource.PropertyValue{V: "true"},
Expand Down

0 comments on commit 05c8368

Please sign in to comment.